OSDN Git Service

* scan-types.sh (VALUE) Wrap use with double quotes to protect
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jun 2000 14:42:09 +0000 (14:42 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jun 2000 14:42:09 +0000 (14:42 +0000)
variable against filename expansion when it contains "char *".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34468 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/scan-types.sh

index f6a6c20..4794c42 100644 (file)
@@ -1,5 +1,8 @@
 2000-06-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * scan-types.sh (VALUE) Wrap use with double quotes to protect
+       variable against filename expansion when it contains "char *".
+
        * system.h (SSIZE_MAX): Delete backup definition.
 
        * cppfiles.c (read_include_file): Use INTTYPE_MAXIMUM(ssize_t)
index a7fa238..59d786a 100755 (executable)
@@ -51,7 +51,10 @@ for TYPE in dev_t clock_t fpos_t gid_t ino_t mode_t nlink_t off_t pid_t size_t s
             eval "VALUE='`${SED} -e 's| *$||' -e '2,$d' <TMP`'"
            # Unless VALUE contains a blank, look for a typedef for it
            # in turn (this could be a loop, but that would be over-kill).
-           if echo $VALUE | grep " " >/dev/null ; then true
+           # Ensure $VALUE is double quoted to protect cases where it
+           # contains an asterisk and would cause filename expansion.
+           # E.g. when va_list is "char *".
+           if echo "$VALUE" | grep " " >/dev/null ; then true
            else
                rm -f TMP
                ${SED} -n -e "s|.*typedef[      ][      ]*\(.*[^a-zA-Z0-9_]\)${VALUE}[  ]*;.*|\1|w TMP" <st-dummy.out>/dev/null