changeset 110485:14057cf8379c

Fix bug#6820: Don't accept backslashes or quotes on compiler options. * nt/configure.bat: Err out when the argument of --cflags contains invalid characters (check implemented only for GCC).
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 23 Sep 2010 01:14:00 +0200
parents 7ca55779eeef
children 1ad1adb298a3
files nt/ChangeLog nt/configure.bat
diffstat 2 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nt/ChangeLog	Wed Sep 22 15:22:06 2010 -0400
+++ b/nt/ChangeLog	Thu Sep 23 01:14:00 2010 +0200
@@ -1,3 +1,8 @@
+2010-09-22  Juanma Barranquero  <lekktu@gmail.com>
+
+	* configure.bat: Err out when the argument of --cflags contains
+	invalid characters (check implemented only for GCC).  (Bug#6820)
+
 2010-08-19  Juanma Barranquero  <lekktu@gmail.com>
 
 	* addpm.c (add_registry): Create App Paths of type REG_EXPAND_SZ.
--- a/nt/configure.bat	Wed Sep 22 15:22:06 2010 -0400
+++ b/nt/configure.bat	Thu Sep 23 01:14:00 2010 +0200
@@ -358,9 +358,25 @@
 @echo gcc %cf% -c junk.c >>config.log
 gcc %cf% -c junk.c >>config.log 2>&1
 set cf=
-if exist junk.o goto gccOk
+if exist junk.o goto chkuser
 echo The failed program was: >>config.log
 type junk.c >>config.log
+goto nocompiler
+
+:chkuser
+rm -f junk.o
+echo int main (int argc, char *argv[]) {>junk.c
+echo char *usercflags = "%usercflags%";>>junk.c
+echo }>>junk.c
+echo gcc -Werror -c junk.c >>config.log
+gcc -Werror -c junk.c >>config.log 2>&1
+if exist junk.o goto gccOk
+echo.
+echo Error in --cflags argument: %usercflags%
+echo Backslashes and quotes cannot be used with --cflags.  Please use forward
+echo slashes for filenames and paths (e.g. when passing directories to -I).
+rm -f junk.c
+goto end
 
 :nocompiler
 echo.