From 55c46b7286f5d9f2d8291158203e2b61d2494420 Mon Sep 17 00:00:00 2001 From: Stefan Potyra Date: Tue, 11 Aug 2009 12:46:26 +1000 Subject: [BUILTIN] Honor tab as IFS whitespace when splitting fields in readcmd When I try to split fields by tabs, dash doesn't honour multiple tabs between fields as whitespace (at least that's how I interpret [1], please correct me if I'm wrong). #!/bin/sh # "1\t2\t\t3" TESTSTRING="1 2 3" # only "\t" IFS=" " echo "$TESTSTRING" | while read p1 p2 p3; do echo "p1=${p1}, p2=${p2}, p3=${p3}" done Signed-off-by: Herbert Xu --- src/expand.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 7995d40..48c45e5 100644 --- a/src/expand.c +++ b/src/expand.c @@ -117,9 +117,6 @@ STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); STATIC ssize_t varvalue(char *, int, int); -STATIC void recordregion(int, int, int); -STATIC void removerecordregions(int); -STATIC void ifsbreakup(char *, struct arglist *); STATIC void ifsfree(void); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB @@ -412,7 +409,7 @@ lose: } -STATIC void +void removerecordregions(int endoff) { if (ifslastp == NULL) @@ -1001,7 +998,7 @@ value: * string for IFS characters. */ -STATIC void +void recordregion(int start, int end, int nulonly) { struct ifsregion *ifsp; @@ -1028,7 +1025,7 @@ recordregion(int start, int end, int nulonly) * strings to the argument list. The regions of the string to be * searched for IFS characters have been stored by recordregion. */ -STATIC void +void ifsbreakup(char *string, struct arglist *arglist) { struct ifsregion *ifsp; -- cgit 1.4.1