find cpp at run time
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 27 Jun 1991 03:21:45 +0000 (19:21 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 27 Jun 1991 03:21:45 +0000 (19:21 -0800)
SCCS-vsn: usr.sbin/amd/fsinfo/fsi_lex.l 5.4

usr/src/usr.sbin/amd/fsinfo/fsi_lex.l

index b52ed2f..e7b9605 100644 (file)
@@ -10,7 +10,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)fsi_lex.l   5.3 (Berkeley) %G%
+ *     @(#)fsi_lex.l   5.4 (Berkeley) %G%
  *
  * $Id: fsi_lex.l,v 5.2.1.3 91/05/07 22:19:03 jsp Alpha $
  *
  *
  * $Id: fsi_lex.l,v 5.2.1.3 91/05/07 22:19:03 jsp Alpha $
  *
@@ -215,7 +215,7 @@ int yywrap()
 static int first = 1;
        if (first) {
                char prog[16*1024];
 static int first = 1;
        if (first) {
                char prog[16*1024];
-               strcpy(prog, "for file in ");
+               strcpy(prog, "cpp=cat; test -r /lib/cpp && cpp=/lib/cpp; test -r /usr/libexec/cpp && cpp=/usr/libexec/cpp; for file in ");
                while (*++g_argv) {
                        if (access(*g_argv, 4) < 0) {
                                error("\"%s\": Cannot open for reading", *g_argv);
                while (*++g_argv) {
                        if (access(*g_argv, 4) < 0) {
                                error("\"%s\": Cannot open for reading", *g_argv);
@@ -225,7 +225,7 @@ static int first = 1;
                                strcat(prog, " ");
                        }
                }
                                strcat(prog, " ");
                        }
                }
-               strcat(prog, "; do /lib/cpp ");
+               strcat(prog, "; do $cpp ");
                strcat(prog, idvbuf);
                strcat(prog, " -DHOSTNAME=\'");
                strcat(prog, hostname);
                strcat(prog, idvbuf);
                strcat(prog, " -DHOSTNAME=\'");
                strcat(prog, hostname);