Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Specification. */
#include "findprog.h"
#else
/* Unix */
char *path;
- char *dir;
+ char *path_rest;
char *cp;
if (strchr (progname, '/') != NULL)
/* Make a copy, to prepare for destructive modifications. */
path = xstrdup (path);
- for (dir = path; ; dir = cp + 1)
+ for (path_rest = path; ; path_rest = cp + 1)
{
+ const char *dir;
bool last;
char *progpathname;
/* Extract next directory in PATH. */
- for (cp = dir; *cp != '\0' && *cp != ':'; cp++)
+ dir = path_rest;
+ for (cp = path_rest; *cp != '\0' && *cp != ':'; cp++)
;
last = (*cp == '\0');
*cp = '\0';