diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:09:56 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:09:56 +0300 |
commit | bc70de7b3302d5a81515b901cae376b8b51d2004 (patch) | |
tree | d36d6743e65697f6923b79d0ea8f9f9bf4ef7398 /atari/tmpnam.c | |
parent | b9e4a1fd4c8c8753ab8a9887bab55f03efe1e3e2 (diff) | |
download | egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.gz egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.bz2 egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.zip |
Move to gawk-3.1.0.
Diffstat (limited to 'atari/tmpnam.c')
-rw-r--r-- | atari/tmpnam.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/atari/tmpnam.c b/atari/tmpnam.c deleted file mode 100644 index 92bf751b..00000000 --- a/atari/tmpnam.c +++ /dev/null @@ -1,47 +0,0 @@ -#ifdef PIPES_SIMULATED -/* tmpnam.c : return a temporary file name */ -/* written by Eric R. Smith and placed in the public domain */ -/** - * - modified for gawk needs - pattern /$$XXXXXX from the original - * code creates names which are hard to remove when somethig - * goes wrong - * - returned name can be passed outside via system(); other programs - * may not dig '/' as a path separator - * - somehow more frugal in a memory use - * (mj - October 1990) - **/ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -extern char * getenv(const char *); -extern char * mktemp(char *); -char * tempnam(const char *path, const char *base); -static char pattern[] = "\\gwkXXXXX"; - -char *tmpnam(buf) - char *buf; -{ - char *tmpdir; - - if (!(tmpdir = getenv("TEMP")) && !(tmpdir = getenv("TMPDIR"))) - tmpdir = "."; - - if (!buf) { - size_t blen; - - blen = strlen (tmpdir) + sizeof(pattern); - if (NULL == (buf = malloc(blen))) - return NULL; - } - (void) strcat(strcpy(buf, tmpdir), pattern); - return(mktemp(buf)); -} - -/* used by gawk_popen() */ -char *tempnam(path, base) -const char *path, *base; /* ignored */ -{ - return tmpnam(NULL); -} -#endif /* PIPES_SIMULATED */ |