aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1993-11-03 00:14:02 -0800
committerPer Bothner <bothner@gcc.gnu.org>1993-11-03 00:14:02 -0800
commit41b21cfc17e6648120f83bad22cfb1df2a670b71 (patch)
tree86b359243ba885543e77f2cba6033e1e2ce4fa98 /gcc
parentc7bfb646244bff1568ff2b1d8615f139a61aac9f (diff)
downloadgcc-41b21cfc17e6648120f83bad22cfb1df2a670b71.zip
gcc-41b21cfc17e6648120f83bad22cfb1df2a670b71.tar.gz
gcc-41b21cfc17e6648120f83bad22cfb1df2a670b71.tar.bz2
Make more robust in two places.
From-SVN: r5978
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/fixproto17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/fixproto b/gcc/fixproto
index eccafcc..c21f1c1 100755
--- a/gcc/fixproto
+++ b/gcc/fixproto
@@ -194,12 +194,17 @@ for code in ALL STD ; do
# Already seen $file; nothing to do
;;
*)
- new_files_to_check="$new_files_to_check `sed -n \
+ if test -f $src_dir_std/$file ; then
+ rel_dir=`echo $file | sed -n -e 's|^\(.*/\)[^/]*$|\1|p'`
+ # For #include "foo.h", that might be either "foo.h"
+ # or "${rel_dir}foo.h (or something bogus).
+ new_files_to_check="$new_files_to_check "`sed -n \
-e 's@ @ @g' \
- -e 's@^ *# *include *<\([^>]*\)>.*$@\1@p' \
- -e 's@^ *# *include *\"\([^\"]*\)\".*$@\1@p' \
- <$src_dir_std/$file`"
- rel_source_files="$rel_source_files $file"
+ -e 's@^ *# *include *<\([^>]*\)>.*$@\1@p' -e \
+ 's@^ *# *include *\"\([^\"]*\)\".*$@\1 '$rel_dir'\1@p'\
+ <$src_dir_std/$file`
+ rel_source_files="$rel_source_files $file"
+ fi
;;
esac
done
@@ -260,7 +265,7 @@ for code in ALL STD ; do
required_list="kill raise" ;;
stdio.h)
required_list="clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell fwrite getc getchar gets perror printf putc putchar puts remove rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ungetc vfprintf vprintf vsprintf"
- if grep _flsbuf <$abs_source_file >/dev/null ; then
+ if grep '[^_a-zA-Z0-9]_flsbuf' <$abs_source_file >/dev/null; then
required_list="$required_list _flsbuf _filbuf"
fi
# Should perhaps also handle NULL, EOF, ... ?