diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-11-03 08:14:02 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-11-03 08:14:02 +0000 |
commit | 2333ee851f7c67b6a664e1799c594961d8ee0137 (patch) | |
tree | 86b359243ba885543e77f2cba6033e1e2ce4fa98 /gcc/fixproto | |
parent | a89e07c7c7a5a425c326c30600040ac3ae1624df (diff) | |
download | gcc-2333ee851f7c67b6a664e1799c594961d8ee0137.tar.gz |
Make more robust in two places.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixproto')
-rwxr-xr-x | gcc/fixproto | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/fixproto b/gcc/fixproto index eccafcce46c..c21f1c1ea0a 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, ... ? |