Skip to content

Commit

Permalink
beecut: accept more than one argument
Browse files Browse the repository at this point in the history
foreach argument print a line containing its splitted elements
  • Loading branch information
mariux committed Jul 7, 2011
1 parent 79131e6 commit 253b7df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/beecut/beecut.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void cut_and_print(char *string, char delimeter, char opt_short, char *prefix, c
s = (opt_short) ? p : string;
}

printf("%s %s%s%s", suffix, prefix, s, suffix);
printf("%s %s%s%s\n", suffix, prefix, s, suffix);
}

int main(int argc, char *argv[])
Expand Down Expand Up @@ -151,9 +151,9 @@ int main(int argc, char *argv[])
exit(1);
}

cut_and_print(argv[optind], delimeter, opt_short, opt_prepend, opt_append);
while(optind < argc)
cut_and_print(argv[optind++], delimeter, opt_short, opt_prepend, opt_append);

printf("\n");

return(0);
}

0 comments on commit 253b7df

Please sign in to comment.