From: David Levine Date: Wed, 22 Jan 2014 02:51:00 +0000 (-0600) Subject: Expose get_temp_dir(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/2b33dce4c4102935f233226bc0cb0adfafd265d0?ds=inline;hp=-c Expose get_temp_dir(). --- 2b33dce4c4102935f233226bc0cb0adfafd265d0 diff --git a/h/prototypes.h b/h/prototypes.h index 97f0544e..0baa026c 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -191,6 +191,7 @@ int m_putenv (char *, char *); int m_rand (unsigned char *, size_t); char *m_mktemp(const char *, int *, FILE **); char *m_mktemp2(const char *, const char *, int *, FILE **); +char *get_temp_dir(); void m_unknown(m_getfld_state_t *, FILE *); int makedir (char *); char *message_id (time_t, int); diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index ca4ab29c..352cb7cd 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -8,8 +8,6 @@ #include -static char *get_temp_dir(); - /* Create a temporary file. If pfx_in is null, the temporary file * will be created in the temporary directory (more on that later). * If pfx_in is not null, then the temporary file location will be @@ -26,7 +24,7 @@ static char *get_temp_dir(); * * When pfx_in is null, the temporary directory is determined as * follows, in order: - * + * * MHTMPDIR envvar * TMPDIR envvar * TMP envvar @@ -90,7 +88,7 @@ m_mktemp ( * by created based on a given pathname. Although m_mktemp() technically * supports this, this version is when the directory is defined by * a separate variable from the prefix, eliminating the caller from having - * to do string manipulation to generate the desired. pathname prefix. + * to do string manipulation to generate the desired pathname prefix. * * The pfx_in parameter specifies a basename prefix for the file. If dir_in * is NULL, then the defined temporary directory (see comments to m_mktemp() @@ -126,7 +124,7 @@ m_mktemp2 ( } -static char * +char * get_temp_dir() { /* Ignore envvars if we are setuid */