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

Diff for /src/usr.bin/patch/patch.c between version 1.74 and 1.74.2.1

version 1.74, 2023/07/19 13:26:20 version 1.74.2.1, 2023/11/20 17:56:22
Line 32 
Line 32 
   
 #include <ctype.h>  #include <ctype.h>
 #include <getopt.h>  #include <getopt.h>
   #include <libgen.h>
 #include <limits.h>  #include <limits.h>
 #include <paths.h>  #include <paths.h>
 #include <stdio.h>  #include <stdio.h>
Line 213 
Line 214 
                         perror("unveil");                          perror("unveil");
                         my_exit(2);                          my_exit(2);
                 }                  }
         if (filearg[0] != NULL)          if (filearg[0] != NULL) {
                   char *origdir;
   
                 if (unveil(filearg[0], "rwc") == -1) {                  if (unveil(filearg[0], "rwc") == -1) {
                         perror("unveil");                          perror("unveil");
                         my_exit(2);                          my_exit(2);
                 }                  }
                   if ((origdir = dirname(filearg[0])) == NULL) {
                           perror("dirname");
                           my_exit(2);
                   }
                   if (unveil(origdir, "rwc") == -1) {
                           perror("unveil");
                           my_exit(2);
                   }
           } else {
                   if (unveil(".", "rwc") == -1) {
                           perror("unveil");
                           my_exit(2);
                   }
           }
         if (filearg[1] != NULL)          if (filearg[1] != NULL)
                 if (unveil(filearg[1], "r") == -1) {                  if (unveil(filearg[1], "r") == -1) {
                         perror("unveil");                          perror("unveil");
Line 228 
Line 245 
                         perror("unveil");                          perror("unveil");
                         my_exit(2);                          my_exit(2);
                 }                  }
         if (unveil(".", "rwc") == -1) {  
                 perror("unveil");  
                 my_exit(2);  
         }  
         if (*rejname != '\0')          if (*rejname != '\0')
                 if (unveil(rejname, "rwc") == -1) {                  if (unveil(rejname, "rwc") == -1) {
                         perror("unveil");                          perror("unveil");

Legend:
Removed from v.1.74  
changed lines
  Added in v.1.74.2.1