[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.37 and 1.38

version 1.37, 2003/08/15 23:09:57 version 1.38, 2003/08/15 23:23:18
Line 402 
Line 402 
         if (bclear(bp) != TRUE)          if (bclear(bp) != TRUE)
                 return NULL;                  return NULL;
         bp->b_flag |= BFREADONLY;          bp->b_flag |= BFREADONLY;
         if (snprintf(line, sizeof(line), "ls -al %s", dirname) >= sizeof(line)){          if (snprintf(line, sizeof(line), "ls -al %s", dirname)
               >= sizeof(line)) {
                 ewprintf("Path too long");                  ewprintf("Path too long");
                 return NULL;                  return NULL;
         }          }
Line 416 
Line 417 
                 (void) addline(bp, line);                  (void) addline(bp, line);
         }          }
         if (pclose(dirpipe) == -1) {          if (pclose(dirpipe) == -1) {
                 ewprintf("Problem closing pipe to ls");                  ewprintf("Problem closing pipe to ls : %s",
                       strerror(errno));
                 return NULL;                  return NULL;
         }          }
         bp->b_dotp = lforw(bp->b_linep);        /* go to first line */          bp->b_dotp = lforw(bp->b_linep);        /* go to first line */
         (void) strlcpy(bp->b_fname, dirname, sizeof bp->b_fname);          (void) strlcpy(bp->b_fname, dirname, sizeof bp->b_fname);
         if ((bp->b_modes[0] = name_mode("dired")) == NULL) {          if ((bp->b_modes[1] = name_mode("dired")) == NULL) {
                 bp->b_modes[0] = name_mode("fundamental");                  bp->b_modes[0] = name_mode("fundamental");
                 ewprintf("Could not find mode dired");                  ewprintf("Could not find mode dired");
                 return NULL;                  return NULL;
         }          }
         bp->b_nmodes = 0;          bp->b_nmodes = 1;
         return bp;          return bp;
 }  }
   
Line 452 
Line 454 
                         return (ABORT);                          return (ABORT);
         }          }
         strlcat(fn, p, len);          strlcat(fn, p, len);
         return lgetc(lp, 2) == 'd';          return (lgetc(lp, 2) == 'd') ? TRUE : FALSE;
 }  }
 #endif                          /* NO_DIRED */  #endif                          /* NO_DIRED */
   

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38