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

Diff for /src/usr.bin/mg/dired.c between version 1.58 and 1.59

version 1.58, 2013/05/30 04:27:18 version 1.59, 2013/05/30 17:43:43
Line 398 
Line 398 
 int  int
 d_copy(int f, int n)  d_copy(int f, int n)
 {  {
         char    frname[NFILEN], toname[NFILEN], sname[NFILEN], *bufp;          char             frname[NFILEN], toname[NFILEN], sname[NFILEN];
         int     ret;          char            *topath, *bufp;
         size_t  off;          int              ret;
         struct buffer *bp;          size_t           off;
           struct buffer   *bp;
   
         if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) {          if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) {
                 ewprintf("Not a file");                  ewprintf("Not a file");
Line 419 
Line 420 
                 return (ABORT);                  return (ABORT);
         else if (bufp[0] == '\0')          else if (bufp[0] == '\0')
                 return (FALSE);                  return (FALSE);
         ret = (copy(frname, toname) >= 0) ? TRUE : FALSE;  
           topath = adjustname(toname, TRUE);
           ret = (copy(frname, topath) >= 0) ? TRUE : FALSE;
         if (ret != TRUE)          if (ret != TRUE)
                 return (ret);                  return (ret);
         if ((bp = refreshbuffer(curbp)) == NULL)          if ((bp = refreshbuffer(curbp)) == NULL)
Line 431 
Line 434 
 int  int
 d_rename(int f, int n)  d_rename(int f, int n)
 {  {
         char             frname[NFILEN], toname[NFILEN], *bufp;          char             frname[NFILEN], toname[NFILEN];
           char            *topath, *bufp;
         int              ret;          int              ret;
         size_t           off;          size_t           off;
         struct buffer   *bp;          struct buffer   *bp;
Line 453 
Line 457 
                 return (ABORT);                  return (ABORT);
         else if (bufp[0] == '\0')          else if (bufp[0] == '\0')
                 return (FALSE);                  return (FALSE);
         ret = (rename(frname, toname) >= 0) ? TRUE : FALSE;  
           topath = adjustname(toname, TRUE);
           ret = (rename(frname, topath) >= 0) ? TRUE : FALSE;
         if (ret != TRUE)          if (ret != TRUE)
                 return (ret);                  return (ret);
         if ((bp = refreshbuffer(curbp)) == NULL)          if ((bp = refreshbuffer(curbp)) == NULL)

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59