diff options
author | imp <imp@FreeBSD.org> | 2001-06-05 04:29:55 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-06-05 04:29:55 +0000 |
commit | b1345499d025833800340932342b19dd1743a9aa (patch) | |
tree | 1051e0a41928310e724ed4c3bf483395663fd438 /games | |
parent | 7006efd19379a10b3c8751102374032a8856f0f8 (diff) | |
download | FreeBSD-src-b1345499d025833800340932342b19dd1743a9aa.zip FreeBSD-src-b1345499d025833800340932342b19dd1743a9aa.tar.gz |
Remove #if 0'd code. It turned up on my MAXPATHLEN + 1 sweep.
Diffstat (limited to 'games')
-rw-r--r-- | games/hack/hack.unix.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index e8ddfca..4638223 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -90,41 +90,6 @@ char *np; if(stat(name, &hbuf)) error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name); -#if 0 -/* version using PATH from: seismo!gregc@ucsf-cgl.ARPA (Greg Couch) */ - - -/* - * The problem with #include <sys/param.h> is that this include file - * does not exist on all systems, and moreover, that it sometimes includes - * <sys/types.h> again, so that the compiler sees these typedefs twice. - */ -#define MAXPATHLEN 1024 - -char *np, *path; -char filename[MAXPATHLEN+1]; - if (index(name, '/') != NULL || (path = getenv("PATH")) == NULL) - path = ""; - - for (;;) { - if ((np = index(path, ':')) == NULL) - np = path + strlen(path); /* point to end str */ - if (np - path <= 1) /* %% */ - (void) strcpy(filename, name); - else { - (void) strncpy(filename, path, np - path); - filename[np - path] = '/'; - (void) strcpy(filename + (np - path) + 1, name); - } - if (stat(filename, &hbuf) == 0) - return; - if (*np == '\0') - break; - path = np + 1; - } - error("Cannot get status of %s.", - (np = rindex(name, '/')) ? np+1 : name); -#endif } uptodate(fd) { |