]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Correctly parse multiple parameter functions and allow dangeling comma
authorCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 25 Jun 2009 14:02:55 +0000 (15:02 +0100)
committerRay Strode <rstrode@redhat.com>
Fri, 24 Jul 2009 13:30:11 +0000 (09:30 -0400)
Typo was causing parsing errors.

src/plugins/splash/script/script-parse.c

index 30f057206b5089515bd8879469aaf32a82fe86e2..e6133a5863a4411988fd731df693e1d4c37bbd4f 100644 (file)
@@ -139,7 +139,7 @@ static script_exp* script_parse_exp_pi (ply_scan_t* scan)
                 script_parse_error (curtoken, "Function parameters should be separated with a ',' and terminated with a ')'");
                 return NULL;
                 }
-            ply_scan_get_next_token(scan);
+            curtoken = ply_scan_get_next_token(scan);
             }
         ply_scan_get_next_token(scan);
         func->data.function.name = exp;
@@ -591,15 +591,15 @@ static script_op* script_parse_function (ply_scan_t* scan)
     curtoken = ply_scan_get_next_token(scan);
     
     if (curtoken->type != PLY_SCAN_TOKEN_TYPE_SYMBOL){
-       script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated ')'");
+       script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated with a ')'");
        return NULL;
        }
     if (curtoken->data.symbol == ')') break;
-    if (curtoken->data.symbol == ','){ 
-       script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated ')'");
+    if (curtoken->data.symbol != ','){ 
+       script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated with a ')'");
        return NULL;
        }
-    ply_scan_get_next_token(scan);
+    curtoken = ply_scan_get_next_token(scan);
     }
  
  curtoken = ply_scan_get_next_token(scan);