embryo: fix getstring
authorbilliob <billiob@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 12 Aug 2011 12:38:52 +0000 (12:38 +0000)
committerbilliob <billiob@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 12 Aug 2011 12:38:52 +0000 (12:38 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/embryo@62380 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/embryo_cc_sc2.c

index e9b6166..0d33a53 100644 (file)
@@ -755,29 +755,29 @@ preproc_expr(cell * val, int *tag)
  * character that caused the input to be ended.
  */
 static char        *
-getstring(char *dest, int max, char *line)
+getstring(char *dest, int max)
 {
-   assert(dest != NULL && line != NULL);
+   assert(dest != NULL);
    *dest = '\0';
-   while (*line <= ' ' && *line != '\0')
-      line++;                  /* skip whitespace */
-   if (*line != '"')
+   while (*lptr <= ' ' && *lptr != '\0')
+      lptr++;                  /* skip whitespace */
+   if (*lptr != '"')
      {
        error(37);              /* invalid string */
      }
-   else if (*line == '\0')
+   else
      {
        int                 len = 0;
 
-       line++;                 /* skip " */
-       while (*line != '"' && *line != '\0')
+       lptr++;                 /* skip " */
+       while (*lptr != '"' && *lptr != '\0')
          {
             if (len < max - 1)
-               dest[len++] = *line;
-            line++;
+               dest[len++] = *lptr;
+            lptr++;
          }                     /* if */
        dest[len] = '\0';
-       if (*line == '"')
+       if (*lptr == '"')
           lptr++;              /* skip closing " */
        else
           error(37);           /* invalid string */
@@ -925,7 +925,7 @@ command(void)
          {
             char                pathname[PATH_MAX];
 
-            lptr = getstring(pathname, sizeof pathname, lptr);
+            lptr = getstring(pathname, sizeof pathname);
             if (pathname[0] != '\0')
               {
                  free(inpfname);
@@ -984,7 +984,7 @@ command(void)
                          lptr++;
                       if (*lptr == '"')
                         {
-                           lptr = getstring(name, sizeof name, lptr);
+                           lptr = getstring(name, sizeof name);
                         }
                       else
                         {