delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/03/19/17:10:42

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <199903192210.XAA22033@father.ludd.luth.se>
Subject: Re: TMPDIR=x:
To: djgpp-workers AT delorie DOT com (DJGPP-WORKERS)
Date: Fri, 19 Mar 1999 23:10:27 +0100 (MET)
X-Mailer: ELM [version 2.4ME+ PL15 (25)]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

It seems that these lines are the culprit:

----- gcc/gnu/gcc-2.81/choose-temp.c excerpt starts. -----
static char *
try (dir, base)
     char *dir, *base;
{
  if (base != 0)
    return base;
  if (dir != 0
      && access (dir, R_OK | W_OK | X_OK) == 0)
    return dir;
  return 0;
}

...

char *
choose_temp_base ()
{
  char *base = 0;

...

  base = try (getenv ("TMPDIR"), base);
  base = try (getenv ("TMP"), base);
  base = try (getenv ("TEMP"), base);

----- gcc/gnu/gcc-2.81/choose-temp.c excerpt ends. -----

In particular the line calling access().

Is there any better way than adding:

"  char tmp_str[MAX_LEN];

  strcpy(tmp_str, base);
  strcat(tmp_str, "/");"

to try()?


Shostakovich, Symphony No. 9,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019