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

Diff for /src/usr.bin/mg/file.c between version 1.40 and 1.41

version 1.40, 2005/10/13 19:46:45 version 1.41, 2005/10/13 20:23:01
Line 6 
Line 6 
  *      File commands.   *      File commands.
  */   */
   
 #include <libgen.h>  
 #include "def.h"  #include "def.h"
   
   #include <libgen.h>
   
 /*  /*
  * Insert a file into the current buffer.  Real easy - just call the   * Insert a file into the current buffer.  Real easy - just call the
  * insertfile routine with the file name.   * insertfile routine with the file name.
Line 205 
Line 206 
 readin(char *fname)  readin(char *fname)
 {  {
         MGWIN   *wp;          MGWIN   *wp;
         int      status, i;          int      status, i, ro = FALSE;
         PF      *ael;          PF      *ael;
   
         /* might be old */          /* might be old */
Line 236 
Line 237 
                 }                  }
         }          }
   
         /* We need to set the READONLY flag after we insert the file. */          /*
            * We need to set the READONLY flag after we insert the file,
            * unless the file is a directory.
            */
         if (access(fname, W_OK) && errno != ENOENT)          if (access(fname, W_OK) && errno != ENOENT)
                   ro = TRUE;
   #ifndef NO_DIRED
           if (fisdir(fname) == TRUE)
                   ro = TRUE;
   #endif
           if (ro == TRUE)
                 curbp->b_flag |= BFREADONLY;                  curbp->b_flag |= BFREADONLY;
         else          else
                 curbp->b_flag &=~ BFREADONLY;                  curbp->b_flag &=~ BFREADONLY;

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41