mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
ash: add/improve comments, no code changes
This commit is contained in:
parent
46aeab9a34
commit
f6fbd62760
@ -12618,14 +12618,16 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
|||||||
}
|
}
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
break;
|
break;
|
||||||
|
/* $IFS splitting */
|
||||||
|
/* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 */
|
||||||
is_ifs = strchr(ifs, c);
|
is_ifs = strchr(ifs, c);
|
||||||
if (startword && is_ifs) {
|
if (startword && is_ifs) {
|
||||||
if (isspace(c))
|
if (isspace(c))
|
||||||
continue;
|
continue;
|
||||||
/* non-space ifs char */
|
/* it is a non-space ifs char */
|
||||||
startword--;
|
startword--;
|
||||||
if (startword == 1) /* first one? */
|
if (startword == 1) /* first one? */
|
||||||
continue;
|
continue; /* yes, it is not next word yet */
|
||||||
}
|
}
|
||||||
startword = 0;
|
startword = 0;
|
||||||
if (ap[1] != NULL && is_ifs) {
|
if (ap[1] != NULL && is_ifs) {
|
||||||
@ -12634,7 +12636,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
|||||||
beg = stackblock();
|
beg = stackblock();
|
||||||
setvar(*ap, beg, 0);
|
setvar(*ap, beg, 0);
|
||||||
ap++;
|
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;
|
startword = isspace(c) ? 2 : 1;
|
||||||
STARTSTACKSTR(p);
|
STARTSTACKSTR(p);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user