diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-31 19:36:58 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-31 19:36:58 +0000 |
commit | f6fbd62760252f90ce95212f5cc33f8204159410 (patch) | |
tree | c93d4e2de96c2c8fbd51c9e94348d2e7bede0570 | |
parent | 46aeab9a349d097307a87d7dfde3057f9e4e6722 (diff) | |
download | busybox-w32-f6fbd62760252f90ce95212f5cc33f8204159410.tar.gz busybox-w32-f6fbd62760252f90ce95212f5cc33f8204159410.tar.bz2 busybox-w32-f6fbd62760252f90ce95212f5cc33f8204159410.zip |
ash: add/improve comments, no code changes
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 1de989ef3..b63a243c9 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12618,14 +12618,16 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
12618 | } | 12618 | } |
12619 | if (c == '\n') | 12619 | if (c == '\n') |
12620 | break; | 12620 | break; |
12621 | /* $IFS splitting */ | ||
12622 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 */ | ||
12621 | is_ifs = strchr(ifs, c); | 12623 | is_ifs = strchr(ifs, c); |
12622 | if (startword && is_ifs) { | 12624 | if (startword && is_ifs) { |
12623 | if (isspace(c)) | 12625 | if (isspace(c)) |
12624 | continue; | 12626 | continue; |
12625 | /* non-space ifs char */ | 12627 | /* it is a non-space ifs char */ |
12626 | startword--; | 12628 | startword--; |
12627 | if (startword == 1) /* first one? */ | 12629 | if (startword == 1) /* first one? */ |
12628 | continue; | 12630 | continue; /* yes, it is not next word yet */ |
12629 | } | 12631 | } |
12630 | startword = 0; | 12632 | startword = 0; |
12631 | if (ap[1] != NULL && is_ifs) { | 12633 | if (ap[1] != NULL && is_ifs) { |
@@ -12634,7 +12636,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
12634 | beg = stackblock(); | 12636 | beg = stackblock(); |
12635 | setvar(*ap, beg, 0); | 12637 | setvar(*ap, beg, 0); |
12636 | ap++; | 12638 | ap++; |
12637 | /* can we skip one non-space ifs? (2: yes) */ | 12639 | /* can we skip one non-space ifs char? (2: yes) */ |
12638 | startword = isspace(c) ? 2 : 1; | 12640 | startword = isspace(c) ? 2 : 1; |
12639 | STARTSTACKSTR(p); | 12641 | STARTSTACKSTR(p); |
12640 | continue; | 12642 | continue; |