From 5a8254fa45f1f8be1216a09889e4d676eb43eb00 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 27 Aug 1999 17:51:40 +0000 Subject: [PATCH] Remove lint from awk script (trailing ;) Improve regex to allow detection of : inside of filenames. Skip files with ':' in name Fix noslash 'next' vs 'continue' bug --- build/mkdep | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/build/mkdep b/build/mkdep index 62e1ad02c8..9c35e59dad 100755 --- a/build/mkdep +++ b/build/mkdep @@ -145,24 +145,26 @@ _EOF_ $MKDEP_CC $MKDEP_CFLAGS $files | \ sed -e 's; \./; ;g' | \ $SED > $TMP.sed -# dont pipe to awk. SGI awk wants a filename as argument. +# do not pipe to awk. SGI awk wants a filename as argument. # (or '-', but I do not know if all other awks support that.) awk ' -$1 ~ /:/ { - filenm=$1; - dep=substr($0, length(filenm)+1); +$1 ~ /:$/ { + filenm=$1 + dep=substr($0, length(filenm)+1) } -$1 !~ /:/ { - dep=$0; +$1 !~ /:$/ { + dep=$0 } /.*/ { - split(dep, depends, " "); + if ( filenm ~ /:.*:$/ ) next + split(dep, depends, " ") for(d in depends) { - dfile = depends[d]; - if (( noslash == "yes") && (dfile ~ /^\// )) next + dfile = depends[d] + if ( dfile ~ /:/ ) continue + if (( noslash == "yes") && (dfile ~ /^\// )) continue if ( length(dfile) < 2 ) continue - rec = filenm " " dfile; - print rec; + rec = filenm " " dfile + print rec } } ' noslash="$NOSLASH" $TMP.sed >> $TMP -- 2.39.5