From 3b82d3ae8fc16d749c74ec5121a516f669aec161 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Mon, 2 Jun 2003 11:04:49 +0000 Subject: [PATCH] oops, not for *nix git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2663 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCglue.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 9b58776a..c317fffc 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -1800,22 +1800,25 @@ tempfileandname(char *fname, size_t len) const char *tmpdir = NULL; int fd; - static int warning_emitted; if ((tmpdir = getenv ("TMP")) == NULL) if ((tmpdir = getenv ("TEMP")) == NULL) tmpdir = getenv ("TMPDIR"); #if defined(_WIN32) - if (tmpdir == NULL) - { - tmpdir = "c:\\"; - if (!warning_emitted) - { - fprintf (stderr, "TMP not defined in environment, using %s for temporary files\n", tmpdir); - warning_emitted = 1; - } - } + { + static int warning_emitted; + + if (tmpdir == NULL) + { + tmpdir = "c:\\"; + if (!warning_emitted) + { + fprintf (stderr, "TMP not defined in environment, using %s for temporary files\n.", tmpdir); + warning_emitted = 1; + } + } + } #else { /* try with /usr/tmp and /tmp on Un*x systems */ @@ -1826,10 +1829,6 @@ tempfileandname(char *fname, size_t len) tmpdir = "/usr/tmp"; else if (stat("/tmp", &statbuf) != -1) tmpdir = "/tmp"; - if (!warning_emitted) { - fprintf (stderr, "TMP not defined in environment, using %s for temporary files\n", tmpdir); - warning_emitted = 1; - } } } #endif -- 2.30.2