diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-15 11:43:11 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-15 11:43:11 +0300 |
commit | 6f373546792c2befaa2d9d0fffb12fda80320042 (patch) | |
tree | 20be35d4d79b4eacf2fedab8574f6b33c8bdad1f /io.c | |
parent | d7a6deaeca178a15c600fbc13262aca29fb39753 (diff) | |
parent | 74ee0dcab17240a1626b77ed998b07f0f6560a48 (diff) | |
download | egawk-6f373546792c2befaa2d9d0fffb12fda80320042.tar.gz egawk-6f373546792c2befaa2d9d0fffb12fda80320042.tar.bz2 egawk-6f373546792c2befaa2d9d0fffb12fda80320042.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 45 |
1 files changed, 0 insertions, 45 deletions
@@ -2505,7 +2505,6 @@ do_getline(int into_variable, IOBUF *iop) typedef struct { const char *envname; char **dfltp; /* pointer to address of default path */ - char try_cwd; /* always search current directory? */ char **awkpath; /* array containing library search paths */ int max_pathlen; /* length of the longest item in awkpath */ } path_info; @@ -2513,13 +2512,11 @@ typedef struct { static path_info pi_awkpath = { /* envname */ "AWKPATH", /* dfltp */ & defpath, - /* try_cwd */ true, }; static path_info pi_awklibpath = { /* envname */ "AWKLIBPATH", /* dfltp */ & deflibpath, - /* try_cwd */ false, }; /* init_awkpath --- split path(=$AWKPATH) into components */ @@ -2577,30 +2574,6 @@ init_awkpath(path_info *pi) #undef INC_PATH } -/* get_cwd -- get current working directory */ - -static char * -get_cwd () -{ -#define BSIZE 100 - char *buf; - size_t bsize = BSIZE; - - emalloc(buf, char *, bsize * sizeof(char), "get_cwd"); - while (true) { - if (getcwd(buf, bsize) == buf) - return buf; - if (errno != ERANGE) { - efree(buf); - return NULL; - } - bsize *= 2; - erealloc(buf, char *, bsize * sizeof(char), "get_cwd"); - } -#undef BSIZE -} - - /* do_find_source --- search $AWKPATH for file, return NULL if not found */ static char * @@ -2622,24 +2595,6 @@ do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi) return NULL; } - /* try current directory before $AWKPATH search */ - if (pi->try_cwd && stat(src, stb) == 0) { - path = get_cwd(); - if (path == NULL) { - *errcode = errno; - return NULL; - } - erealloc(path, char *, strlen(path) + strlen(src) + 2, "do_find_source"); -#ifdef VMS - if (strcspn(path,">]:") == strlen(path)) - strcat(path, "/"); -#else - strcat(path, "/"); -#endif - strcat(path, src); - return path; - } - if (pi->awkpath == NULL) init_awkpath(pi); |