From c3ad2ccc5e82fc3291274765a0b2f507152b168d Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 16 Sep 1994 12:41:55 +0000 Subject: [PATCH] Improved driver, handles quotes better --- lang/cem/lint/lpass2/lint | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lang/cem/lint/lpass2/lint b/lang/cem/lint/lpass2/lint index c821538ef..719cd0ae7 100755 --- a/lang/cem/lint/lpass2/lint +++ b/lang/cem/lint/lpass2/lint @@ -28,7 +28,7 @@ NEW=/usr/tmp/lint2.$$ trap "rm -f $TMP $NEW; exit 1" 1 2 15 trap "rm -f $TMP $NEW; exit 0" 0 -set dummy $LINTFLAGS $@ # dummy as a shield for $LINTFLAGS +set dummy $LINTFLAGS "$@" # dummy as a shield for $LINTFLAGS shift # remove dummy LIBRARY= @@ -49,7 +49,16 @@ do PARAMS1="$PARAMS1 -R" shift ;; - -[DUI]*)# Define, Undef and Include; for pass 1 only + -D*=*) # Define with equal sign; for pass 1 only + # be careful about funny characters in -D + # this is still not entirely correct + HD=`expr "$1" : '\([^=]*\)=.*'` + TL=`expr "$1" : '[^=]*=\(.*\)'` + PARAMS1="$PARAMS1 $HD='$TL'" + shift + ;; + -[DUI]*)# Define, Undef and Include, otherwise; for pass 1 only + # this is the simple case PARAMS1="$PARAMS1 $1" shift ;; @@ -89,7 +98,8 @@ case "$LIBRARY" in ;; *.c) # a real C-file STATNR=` expr $STATNR + 1 ` - $LPASS1 -S$STATNR -Dlint $PARAMS1 $INCLUDES $F + eval "$LPASS1 -S$STATNR -Dlint \ + $PARAMS1 $INCLUDES $F" ;; *) # a lint library? case `basename $F` in @@ -140,7 +150,7 @@ case "$LIBRARY" in do case $F in *.c) # a C file - $LPASS1 $PARAMS1 $INCLUDES -Dlint -L $F + eval "$LPASS1 $PARAMS1 $INCLUDES -Dlint -L $F" ;; *) # a library? case `basename $F` in