[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.106 and 1.107

version 1.106, 2019/06/22 10:21:57 version 1.107, 2021/02/23 08:10:51
Line 330 
Line 330 
  * to the startup file name.   * to the startup file name.
  */   */
 char *  char *
 startupfile(char *suffix)  startupfile(char *suffix, char *conffile)
 {  {
         static char      file[NFILEN];          static char      file[NFILEN];
         char            *home;          char            *home;
Line 339 
Line 339 
         if ((home = getenv("HOME")) == NULL || *home == '\0')          if ((home = getenv("HOME")) == NULL || *home == '\0')
                 goto nohome;                  goto nohome;
   
         if (suffix == NULL) {          if (conffile != NULL) {
                   (void)strncpy(file, conffile, NFILEN);
           } else if (suffix == NULL) {
                 ret = snprintf(file, sizeof(file), _PATH_MG_STARTUP, home);                  ret = snprintf(file, sizeof(file), _PATH_MG_STARTUP, home);
                 if (ret < 0 || ret >= sizeof(file))                  if (ret < 0 || ret >= sizeof(file))
                         return (NULL);                          return (NULL);

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.107