From 669b7396d4511573586c48bc855a4384669a896c Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Thu, 19 Sep 2013 13:50:27 +0800 Subject: [PATCH] Insure flook compile without warning when ENVFUN is 0. --- flook.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flook.c b/flook.c index 5f7875f..403f9fd 100644 --- a/flook.c +++ b/flook.c @@ -76,15 +76,15 @@ boolean fexist( const char *fname) */ char *flook( const char *fname, int hflag) { - char *home; /* path to home directory */ - char *path; /* environmental PATH variable */ - char *sp; /* pointer into path spec */ int i; /* index */ static char fspec[NSTRING]; /* full path spec to search */ #if ENVFUNC + char *path; /* environmental PATH variable */ if (hflag) { + char *home; /* path to home directory */ + home = getenv("HOME"); if (home != NULL) { /* build home dir file spec */ @@ -109,6 +109,7 @@ char *flook( const char *fname, int hflag) path = getenv("PATH"); if (path != NULL) while (*path) { + char *sp; /* pointer into path spec */ /* build next possible file spec */ sp = fspec;