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

Diff for /src/usr.bin/cvs/release.c between version 1.3 and 1.4

version 1.3, 2005/05/17 08:16:03 version 1.4, 2005/05/19 15:31:35
Line 129 
Line 129 
 {  {
         FILE *fp;          FILE *fp;
         int j, l;          int j, l;
           char *wdir, cwd[MAXPATHLEN];
         char buf[256], cdpath[MAXPATHLEN], dpath[MAXPATHLEN];          char buf[256], cdpath[MAXPATHLEN], dpath[MAXPATHLEN];
         char updcmd[MAXPATHLEN];        /* XXX find a better size; malloc()?? */          char updcmd[MAXPATHLEN];        /* XXX find a better size; malloc()?? */
         struct stat st;          struct stat st;
Line 160 
Line 161 
                 }                  }
   
                 if (root->cr_method != CVS_METHOD_LOCAL) {                  if (root->cr_method != CVS_METHOD_LOCAL) {
                           /* XXX kept for compat reason of `cvs update' output */
                           /* save current working directory for further use */
                           if ((wdir = getcwd(cwd, sizeof(cwd))) == NULL)
                                   cvs_log(LP_ERRNO, "cannot get current dir");
   
                         /* change dir before running the `cvs update' command */                          /* change dir before running the `cvs update' command */
                         if (chdir(dpath) == -1)                          if (chdir(dpath) == -1) {
                                   cvs_log(LP_ERRNO, "cannot change to dir `%s'",
                                       dpath);
                                 return (-1);                                  return (-1);
                           }
   
                         /* construct `cvs update' command */                          /* construct `cvs update' command */
                         l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update",                          l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update",
Line 191 
Line 200 
   
                         printf("You have [%d] altered file%s in this "                          printf("You have [%d] altered file%s in this "
                             "repository.\n", j, j > 1 ? "s" : "");                              "repository.\n", j, j > 1 ? "s" : "");
   
                         printf("Are you sure you want to release "                          printf("Are you sure you want to release "
                             "%sdirectory `%s': ",                              "%sdirectory `%s': ",
                             dflag ? "(and delete) " : "", dpath);                              dflag ? "(and delete) " : "", dpath);
Line 202 
Line 212 
                                 return (-1);                                  return (-1);
                         }                          }
   
                           /* change back to original working dir */
                           if (chdir(wdir) == -1) {
                                   cvs_log(LP_ERRNO, "cannot change to original "
                                       "working dir `%s'", wdir);
                                   return (-1);
                           }
   
                         if (dflag == 1) {                          if (dflag == 1) {
                                 if (unlink(dpath) == -1) {                                  if (cvs_remove_dir(dpath) != CVS_EX_OK) {
                                         cvs_log(LP_ERRNO,                                          cvs_log(LP_ERRNO,
                                             "deletion of directory %s failed",                                              "deletion of directory `%s' failed",
                                             dpath);                                              dpath);
                                         return (-1);                                          return (-1);
                                 }                                  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4