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

Diff for /src/usr.bin/rcs/co.c between version 1.67 and 1.68

version 1.67, 2006/03/27 21:56:32 version 1.68, 2006/03/29 08:44:08
Line 361 
Line 361 
         }          }
   
         if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) {          if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) {
                 if (verbose == 0) {                  /*
                         cvs_log(LP_ERR,                   * XXX - Not sure what is "right".  If we go according
                             "writable %s exists; checkout aborted",                   * to GNU's behavior, an existing file with no writable
                             dst);                   * bits is overwritten without prompting the user.
                         return (-1);                   *
                 }                   * This is dangerous, so we always prompt.
                    * Unfortunately this interferes with an unlocked
                 if (st.st_mode & S_IWUSR)                   * checkout followed by a locked checkout, which should
                    * not prompt.  One (unimplemented) solution is to check
                    * if the existing file is the same as the checked out
                    * revision, and prompt if there are differences.
                    */
                   if (st.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH))
                         printf("writable ");                          printf("writable ");
                 printf("%s exists%s; ", dst,                  printf("%s exists%s; ", dst,
                     (getuid() == st.st_uid) ? "" :                      (getuid() == st.st_uid) ? "" :
Line 376 
Line 381 
                 printf("remove it? [ny](n): ");                  printf("remove it? [ny](n): ");
                 /* default is n */                  /* default is n */
                 if (cvs_yesno() == -1) {                  if (cvs_yesno() == -1) {
                         cvs_log(LP_ERR, "checkout aborted");                          if ((verbose == 1) && isatty(STDIN_FILENO))
                                   cvs_log(LP_ERR,
                                       "writable %s exists; checkout aborted",
                                       dst);
                           else
                                   cvs_log(LP_ERR, "checkout aborted");
                         return (-1);                          return (-1);
                 }                  }
         }          }

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68