ash: add/improve comments, no code changes
authorDenis Vlasenko <vda.linux@googlemail.com>
Tue, 31 Mar 2009 19:36:58 +0000 (19:36 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Tue, 31 Mar 2009 19:36:58 +0000 (19:36 -0000)
shell/ash.c

index 1de989ef31988671419071db93c6a45cd1fb7523..b63a243c97a97806a1e08d317b996d03f093b3ee 100644 (file)
@@ -12618,14 +12618,16 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
                }
                if (c == '\n')
                        break;
+               /* $IFS splitting */
+/* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05        */
                is_ifs = strchr(ifs, c);
                if (startword && is_ifs) {
                        if (isspace(c))
                                continue;
-                       /* non-space ifs char */
+                       /* it is a non-space ifs char */
                        startword--;
                        if (startword == 1) /* first one? */
-                               continue;
+                               continue; /* yes, it is not next word yet */
                }
                startword = 0;
                if (ap[1] != NULL && is_ifs) {
@@ -12634,7 +12636,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
                        beg = stackblock();
                        setvar(*ap, beg, 0);
                        ap++;
-                       /* can we skip one non-space ifs? (2: yes) */
+                       /* can we skip one non-space ifs char? (2: yes) */
                        startword = isspace(c) ? 2 : 1;
                        STARTSTACKSTR(p);
                        continue;