version 1.101, 2016/07/04 03:24:48 |
version 1.102, 2016/07/28 21:37:45 |
|
|
|
|
/* |
/* |
* For applications that use mg as the editor and have a desire to keep |
* For applications that use mg as the editor and have a desire to keep |
* '~' files in the TMPDIR, toggle the location: /tmp | ~/.mg.d |
* '~' files in /tmp, toggle the location: /tmp | ~/.mg.d |
*/ |
*/ |
int |
int |
toggleleavetmp(int f, int n) |
toggleleavetmp(int f, int n) |
|
|
int |
int |
bkupleavetmp(const char *fn) |
bkupleavetmp(const char *fn) |
{ |
{ |
char *tmpdir, *tmp = NULL; |
char *tmp = NULL; |
|
|
if (!leavetmp) |
if (!leavetmp) |
return(FALSE); |
return(FALSE); |
|
|
if((tmpdir = getenv("TMPDIR")) != NULL && *tmpdir != '\0') { |
|
tmp = strstr(fn, tmpdir); |
|
if (tmp == fn) |
|
return (TRUE); |
|
|
|
return (FALSE); |
|
} |
|
|
|
tmp = strstr(fn, "/tmp"); |
tmp = strstr(fn, "/tmp"); |
if (tmp == fn) |
if (tmp == fn) |