Oops -- forgot that we still have to be able to read standard in!
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Tue, 2 Apr 1991 03:10:35 +0000 (19:10 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Tue, 2 Apr 1991 03:10:35 +0000 (19:10 -0800)
SCCS-vsn: usr.bin/cpp/cpp.sh 6.5

usr/src/usr.bin/cpp/cpp.sh

index 6158da5..76ac4c3 100644 (file)
@@ -9,17 +9,19 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)cpp.sh      6.4 (Berkeley) %G%
+#      @(#)cpp.sh      6.5 (Berkeley) %G%
 #
 # Transitional front end to CCCP to make it behave like (Reiser) CCP:
 #      specifies -traditional
 #      doesn't search gcc-include
 #
 #
 # Transitional front end to CCCP to make it behave like (Reiser) CCP:
 #      specifies -traditional
 #      doesn't search gcc-include
 #
-cpp="eval /usr/libexec/cpp"
+PATH=/usr/bin:/bin
+CPP=/usr/libexec/cpp
 ALST="-traditional -D__GNUC__ -$ "
 NSI=no
 OPTS=""
 INCS="-nostdinc"
 ALST="-traditional -D__GNUC__ -$ "
 NSI=no
 OPTS=""
 INCS="-nostdinc"
+FOUNDFILES=no
 
 for A
 do
 
 for A
 do
@@ -39,14 +41,25 @@ do
                OPTS="$OPTS '$A'"
                ;;
        *)
                OPTS="$OPTS '$A'"
                ;;
        *)
+               FOUNDFILES=yes
                if [ $NSI = "no" ]
                then
                        INCS="$INCS -I/usr/include"
                        NSI=skip
                fi
                if [ $NSI = "no" ]
                then
                        INCS="$INCS -I/usr/include"
                        NSI=skip
                fi
-               $cpp $ALST $INCS $LIBS $CSU $OPTS $A || exit $?
+               eval $CPP $ALST $INCS $LIBS $CSU $OPTS $A || exit $?
                ;;
        esac
 done
 
                ;;
        esac
 done
 
+if [ $FOUNDFILES = "no" ]
+then
+       # read standard input
+       if [ $NSI = "no" ]
+       then
+               INCS="$INCS -I/usr/include"
+       fi
+       eval exec $CPP $ALST $INCS $LIBS $CSU $OPTS
+fi
+
 exit 0
 exit 0