aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2021-04-14 01:37:19 -0500
committerRob Landley <rob@landley.net>2021-04-14 01:37:19 -0500
commit31eb5b82db0f1ec4a7d444fe2d53e2327f1cdd02 (patch)
treecc65e6dccc3638c3030d5f87f54d95060c235f9a
parent9259cb7c87191a34451c6e295994785e6b35755a (diff)
downloadtoybox-31eb5b82db0f1ec4a7d444fe2d53e2327f1cdd02.tar.gz
Fix $IFS: skip trailing whitespace after first non-whitespace separator.
-rw-r--r--toys/pending/sh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/pending/sh.c b/toys/pending/sh.c
index 0ccaa792..02277fe0 100644
--- a/toys/pending/sh.c
+++ b/toys/pending/sh.c
@@ -1779,9 +1779,10 @@ barf:
}
// Skip trailing seperator (combining whitespace)
+ kk = 0;
while ((jj = utf8chr(ss, TT.ff->ifs, &ll))) {
+ if (!iswspace(jj) && kk++) break;
ss += ll;
- if (!iswspace(jj)) break;
}
} while (*(ifs = ss));
} while (!(mm == aa.c));