diff options
-rw-r--r-- | name.c | 12 | ||||
-rw-r--r-- | re.c | 1 |
2 files changed, 3 insertions, 10 deletions
@@ -6,9 +6,9 @@ #include <sys/select.h> #include <sys/wait.h> -#define MAXFILES 100 /* Maximum number of files. */ -#define MAXFILE 255 /* Maximum file name length. */ -#define MAXLINE MAXFILE+1 /* MAXFILE plus newline. */ +#define MAXFILES 100 +#define MAXFILE 255 +#define MAXLINE MAXFILE+1 extern char *optarg; extern int optind; @@ -23,7 +23,6 @@ main(int argc, char *argv[]) FILE *fp; int c, i, j, s, xflag; - /* Allocate memory. */ for(i = 0; i < MAXFILES; i++) if(!(froms[i] = malloc(MAXFILE)) || !(tos[i] = malloc(MAXFILE))) err(1, "malloc"); @@ -42,7 +41,6 @@ main(int argc, char *argv[]) return 1; } - /* Read command-line options. */ name = argv[0]; xflag = 0; while((c = getopt(argc, argv, "x")) != -1) @@ -81,10 +79,6 @@ usage: fprintf(stderr, "usage: %s [-x]\n", name); return 1; } - /* - * The corresponding mv invocations are printed on standard out. - * If the -x flag is given, they are executed too. - */ for(i = 0; i < j; i++){ escape(froms[i], &tmp); printf("mv -- '%s'", tmp); escape(tos[i], &tmp); printf(" '%s'\n", tmp); @@ -14,7 +14,6 @@ main(int argc, char *argv[]) return 1; } - /* Ensure arguments do not contain newlines. */ for(i = 1; i < argc; i++) for(a = argv[i]; *a; a++) if(*a == '\n'){ |