[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests defs: sanitize IFS (was: Re: [PATCH] coverage: test semant
From: |
Stefano Lattarini |
Subject: |
[PATCH] tests defs: sanitize IFS (was: Re: [PATCH] coverage: test semantics of "dummy" per-object flags) |
Date: |
Sun, 23 Jan 2011 12:56:45 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Saturday 22 January 2011, Ralf Wildenhues wrote:
>
> > +. ./defs || Exit 1
> > +
> > +set -e
> > +
> > +# Disable shell globbing if possible.
> > +(set +f) >/dev/null 2>&1 && set +f
> > +
> > +oIFS=$IFS
> > +nl='
> > +'
>
> Please go ahead and commit a separate patch to maint that initializes
> IFS with space, tab, newline, in that order, so an unset IFS (which is
> Posix-conforming) doesn't mess up IFS changes. Prior to this patch.
> Thank you.
>
Done in the attached patch. OK for maint?
Thanks,
Stefano
From 8103691531f75eca08e81a539e3dca1ccab4b0dd Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sun, 23 Jan 2011 12:54:35 +0100
Subject: [PATCH] tests defs: sanitize IFS
* tests/defs.in ($IFS): Define to <space>, <tab>, <newline>.
($sp): New variable, holding a single whitespace character.
($tab): New variable, holding a tabulation character.
($nl): New variable, holding a newline character.
---
ChangeLog | 8 ++++++++
tests/defs.in | 11 +++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 48f0ce2..a12a8d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-23 Stefano Lattarini <address@hidden>
+
+ tests defs: sanitize IFS
+ * tests/defs.in ($IFS): Define to <space>, <tab>, <newline>.
+ ($sp): New variable, holding a single whitespace character.
+ ($tab): New variable, holding a tabulation character.
+ ($nl): New variable, holding a newline character.
+
2011-01-22 Ralf Wildenhues <address@hidden>
tests: fix VPATH auto-expansion workarounds.
diff --git a/tests/defs.in b/tests/defs.in
index ee19dbe..b579c1f 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -34,6 +34,17 @@ else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
+# A single whitespace character.
+sp=' '
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+
+# Sanitize IFS.
+IFS=$sp$tab$nl
+
# Ensure we are running from the right directory.
test -f ./defs || {
echo "defs: not found in current directory" 1>&2
--
1.7.2.3
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, (continued)
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Ralf Wildenhues, 2011/01/21
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Stefano Lattarini, 2011/01/22
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Ralf Wildenhues, 2011/01/22
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Stefano Lattarini, 2011/01/22
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Ralf Wildenhues, 2011/01/22
- [PATCH] coverage: test semantics of "dummy" per-object flags (was: Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups), Stefano Lattarini, 2011/01/22
- Re: [PATCH] coverage: test semantics of "dummy" per-object flags, Ralf Wildenhues, 2011/01/22
- Re: [PATCH] coverage: test semantics of "dummy" per-object flags, Stefano Lattarini, 2011/01/23
- Re: [PATCH] coverage: test semantics of "dummy" per-object flags, Ralf Wildenhues, 2011/01/23
- Re: [PATCH] coverage: test semantics of "dummy" per-object flags, Stefano Lattarini, 2011/01/23
- [PATCH] tests defs: sanitize IFS (was: Re: [PATCH] coverage: test semantics of "dummy" per-object flags),
Stefano Lattarini <=
- Re: [PATCH] tests defs: sanitize IFS, Ralf Wildenhues, 2011/01/23
- Re: [PATCH] tests defs: sanitize IFS, Stefano Lattarini, 2011/01/23
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Stefano Lattarini, 2011/01/22
- Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups, Ralf Wildenhues, 2011/01/22