autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spaces in the checks with ac_unique_file break the program


From: Paul Eggert
Subject: Re: Spaces in the checks with ac_unique_file break the program
Date: Thu, 23 Jun 2005 19:16:40 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

"Ralf Wildenhues" <address@hidden> writes:

>>  '* | *'     '* | *' '* | *\"* | *\#* | *\$* | *\&* | *\'* | *\(* | *\)* | \
>>    *\** | *\;* | *\<* | *\=* | *\>* | *\?* | *\@<:@* | *\\* | *\`* | \
>>    *\|* | \~*)
>> -    AC_MSG_WARN([Directory name `$ac_dir' contains special characters]);;
>> +    AC_MSG_ERROR([$ac_var directory name `$ac_dir' has special 
>> characters]);;
>
> AFAICS, this will break on Tru64, as noted in 'Limitations of Builtins'.

Thanks for catching that.  The patch below fixes that.

I think it's worth erroring out, since sufficiently-poorly chosen
names could cause havoc.

> Why do you think $srcdir cannot contain backslashes here?

Because the above-quoted code diagnoses the backslashes and exits.

Alexandre Duret-Lutz <address@hidden> writes:

> (NEWS still says "warns")

Thanks for catching that.  Patch below.

> Diagnosing "space in srcdir" as an error sounds sane to me, because
> $(srcdir) is used in targets and dependences in Makefiles, and space
> is wrong there.
>
> However I can't see what's wrong with spaces in installation
> directories.  I believe these are not used by Autoconf, and Automake
> has test cases to ensure this works,

Wow!  That's news to me.  I thought it didn't work at all.  Thanks for
letting me know.  Presumably there are still some quoting bugs in this
area in Autoconf, but we should fix them rather than masking them.

I installed the following patch.

2005-06-23  Paul Eggert  <address@hidden>

        * NEWS: Don't worry about spaces in bindir etc.  Only srcdir and working
        directory have inherent problems with special characters like spaces,
        due to limitations in Make syntax.  Problem reported by Alexandre
        Duret-Lutz.
        * lib/autoconf/general.m4 (_AC_INIT_DIRCHECK): Implement the above.
        Also, fix Tru64 porting problem with shell patterns,
        reported by Ralf Wildenhues.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.342
diff -p -u -r1.342 NEWS
--- NEWS        1 Jun 2005 07:16:50 -0000       1.342
+++ NEWS        24 Jun 2005 02:09:31 -0000
@@ -1,7 +1,7 @@
 * Major changes in Autoconf 2.59c
 
-** The configure command now warns you if you attempt to use a directory
-  whose name contains a special character like space, newline, or "\".
+** The configure command now diagnoses attempts to use a working or source
+  directory whose name contains a special character like space, newline, or 
"\".
   Such names are not supported, and can cause "configure" to crash.
 
 ** The configure command now redirects standard input from /dev/null,
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.867
diff -p -u -r1.867 general.m4
--- lib/autoconf/general.m4     23 Jun 2005 20:09:27 -0000      1.867
+++ lib/autoconf/general.m4     24 Jun 2005 02:09:31 -0000
@@ -467,12 +467,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" ||
   AC_MSG_ERROR([Working directory cannot be determined])
 
 ac_pat="[[\$][{][_$as_cr_Letters][_$as_cr_alnum]*[}]]"
+ac_pat1='*[)]*'
 
-for ac_var in ac_pwd srcdir \
-  bindir sbindir libexecdir datarootdir datadir \
-  sysconfdir sharedstatedir localstatedir includedir \
-  oldincludedir docdir infodir htmldir dvidir pdfdir \
-  psdir libdir localedir mandir
+for ac_var in ac_pwd srcdir
 do
   # Remove references to shell or make variables.
   eval ac_dir=\$$ac_var
@@ -492,7 +489,7 @@ do
   # Preserve that tab character below!
   case $ac_dirx in
   '' | -* | */-* | *'
-'* | *'        '* | *' '* | *\"* | *\#* | *\$* | *\&* | *\'* | *\(* | *\)* | \
+'* | *'        '* | *' '* | *\"* | *\#* | *\$* | *\&* | *\'* | *\(* | $ac_pat1 
| \
   *\** | *\;* | *\<* | *\=* | *\>* | *\?* | *\@<:@* | *\\* | *\`* | \
   *\|* | \~*)
     AC_MSG_ERROR([$ac_var directory name `$ac_dir' has special characters]);;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]