]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/script-token.c
(no commit message)
[imagemagick] / MagickWand / script-token.c
index 17b52a82c80b2097439e55d7feac2c2e301cc618..62e7d0b9893a27c2dd76b4e1408cf230fed45c95 100644 (file)
@@ -15,7 +15,7 @@
 %                               January 2012                                  %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2013 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  %
 %    o filename   the filename to open  ("-" means stdin)
 %
 */
-WandExport ScriptTokenInfo *AcquireScriptTokenInfo(char *filename)
+WandExport ScriptTokenInfo *AcquireScriptTokenInfo(const char *filename)
 {
   ScriptTokenInfo
     *token_info;
@@ -364,16 +364,19 @@ WandExport MagickBooleanType GetScriptToken(ScriptTokenInfo *token_info)
     offset;
 
   /* EOF - no more tokens! */
+  if (token_info == (ScriptTokenInfo *) NULL)
+    return(MagickFalse);
   if (token_info->status != TokenStatusOK)
     {
       token_info->token[0]='\0';
       return(MagickFalse);
     }
-
   state=IN_WHITE;
   quote='\0';
   offset=0;
+DisableMSCWarning(4127)
   while(1)
+RestoreMSCWarning
   {
     /* get character */
     GetChar(c);
@@ -389,7 +392,7 @@ WandExport MagickBooleanType GetScriptToken(ScriptTokenInfo *token_info)
       if ( ( c == '#' ) ||
            ( token_info->curr_column==1 && (c == ':' || c == '@' ) ) )
         state=IN_COMMENT;
-    /* whitespace token seperator character */
+    /* whitespace token separator character */
     if (strchr(" \n\r\t",c) != (char *)NULL) {
       switch (state) {
         case IN_TOKEN: