]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/list.c
(no commit message)
[imagemagick] / MagickCore / list.c
index 35ae50d7d5989ca2291e9f1ce2f16274b241c42f..6c140b1703e3d867d07de75bc91eb377062155b2 100644 (file)
 %                        MagickCore Image List Methods                        %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                               December 2002                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -382,7 +382,7 @@ MagickExport void DeleteImages(Image **images,const char *scenes,
   */
   for (p=(char *) scenes; *p != '\0';)
   {
-    while ((isspace((int) *p) != 0) || (*p == ','))
+    while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
       p++;
     first=strtol(p,&p,10);
     if (first < 0)
@@ -599,10 +599,9 @@ MagickExport Image *GetImageFromList(const Image *images,const ssize_t index)
 
   /*
     Designed to efficiently find first image (index == 0), or last image
-    (index == -1) as appropriate, without to go through the whole image list,
-    unless the offset is outside of the list length range.
-
-    That is it tries to avoid 'counting the whole list' to handle the index.
+    (index == -1) as appropriate, without to go through the whole image list.
+    That is it tries to avoid 'counting the whole list' to  handle the
+    most common image indexes.
   */
   if ( index < 0 )
     {
@@ -944,9 +943,14 @@ MagickExport Image *NewImageList(void)
 %    o image: the image.
 %
 */
-MagickExport void PrependImageToList(Image **images,Image *image)
+MagickExport void PrependImageToList(Image **images,Image *prepend)
 {
-  AppendImageToList(&image,*images);
+  if (*images == (Image *) NULL)
+    {
+      *images=prepend;
+      return;
+    }
+  AppendImageToList(&prepend,*images);
 }
 \f
 /*