[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] quote language related variables in case they have garbage
From: |
Ralf Wildenhues |
Subject: |
Re: [patch] quote language related variables in case they have garbage |
Date: |
Sun, 16 Mar 2008 09:34:34 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
* Mike Frysinger wrote on Sun, Mar 16, 2008 at 08:57:25AM CET:
> On Sunday 16 March 2008, Ralf Wildenhues wrote:
> > * Mike Frysinger wrote on Sun, Mar 16, 2008 at 08:36:20AM CET:
> > > if you set a language variable with quotes or semicolons or other weird
> > > things, you may get ugly warnings/errors when indirectly evaluating them.
> >
> > Please provide an example, including all output, that exposes this.
> > I can't see what case it would fix.
>
> i did say a language variable set oddly ...
>
> tar xf libtool-1.5.26.tar.bz2
> cd libtool-1.5.26
> export LANGUAGE='a;b;c'
> ./configure && make
> <things quickly fall apart>
Ah, ok, thanks. But your fix isn't right. If LANGUAGE contains double
quotes, then your fix will still do the wrong thing.
I've applied this instead, which should fix things for good in HEAD,
and put you in THANKS. Do you care about a brackport to branch-1-5?
Thanks,
Ralf
2008-03-16 Ralf Wildenhues <address@hidden>
* libltdl/config/ltmain.m4sh (NLS nuisances): Fix quoting of
localization variables for shell-active characters.
* tests/localization.at (localized compiler messages): Extend
test.
* THANKS: Update.
Report by Mike Frysinger.
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.101
diff -u -r1.101 ltmain.m4sh
--- libltdl/config/ltmain.m4sh 13 Mar 2008 04:46:08 -0000 1.101
+++ libltdl/config/ltmain.m4sh 16 Mar 2008 08:31:01 -0000
@@ -104,7 +104,7 @@
save_$lt_var=\$$lt_var
$lt_var=C
export $lt_var
- lt_user_locale=\"$lt_var=\$save_$lt_var; \$lt_user_locale\"
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
fi"
done
Index: tests/localization.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/localization.at,v
retrieving revision 1.1
diff -u -r1.1 localization.at
--- tests/localization.at 9 Mar 2008 14:12:10 -0000 1.1
+++ tests/localization.at 16 Mar 2008 08:31:01 -0000
@@ -34,6 +34,9 @@
AT_DATA([a.c],
[[int x[-1];
]])
+AT_DATA([b.c],
+[[int y;
+]])
AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr])
mv -f stdout expected-stdout
@@ -44,4 +47,11 @@
LTBASE=`$ECHO "$LIBTOOL" | sed 's,^.*/,,'`
AT_CHECK([grep -v "^$LTBASE: compile" stdout | diff expected-stdout -])
+# check that we get our quoting right.
+LANGUAGE='a; nosuchprogram " '\'' & $x /#+*(){}|,:`\ !%'
+export LANGUAGE
+AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c b.c],
+ [0], [stdout], [stderr])
+AT_CHECK([grep nosuchprogram stdout stderr], [1])
+
AT_CLEANUP