sh should truncate for new files
This commit is contained in:
parent
e7b2e5a006
commit
188b4b4a04
@ -602,7 +602,7 @@ _done:
|
|||||||
if (next_is_file) {
|
if (next_is_file) {
|
||||||
if (next_is_file == 1 && !strcmp(c, WRITE_TOKEN)) {
|
if (next_is_file == 1 && !strcmp(c, WRITE_TOKEN)) {
|
||||||
next_is_file = 2;
|
next_is_file = 2;
|
||||||
file_args[cmdi] |= O_APPEND;
|
file_args[cmdi] = O_WRONLY | O_CREAT | O_APPEND;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
output_files[cmdi] = c;
|
output_files[cmdi] = c;
|
||||||
@ -611,7 +611,7 @@ _done:
|
|||||||
|
|
||||||
if (!strcmp(c, WRITE_TOKEN)) {
|
if (!strcmp(c, WRITE_TOKEN)) {
|
||||||
next_is_file = 1;
|
next_is_file = 1;
|
||||||
file_args[cmdi] = O_WRONLY | O_CREAT;
|
file_args[cmdi] = O_WRONLY | O_CREAT | O_TRUNC;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user