[BACK]Return to fileio.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/fileio.c between version 1.101 and 1.102

version 1.101, 2016/07/04 03:24:48 version 1.102, 2016/07/28 21:37:45
Line 664 
Line 664 
   
 /*  /*
  * 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)
Line 681 
Line 681 
 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)

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.102