fix(shorten): exit 3 if removal would leave the file empty
This commit is contained in:
parent
3cc9e61a62
commit
c818b3c732
|
@ -114,8 +114,8 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
// Beginning of file?
|
// Beginning of file?
|
||||||
if (lseek(fd, 0, SEEK_CUR) == 0) {
|
if (lseek(fd, 0, SEEK_CUR) == 0) {
|
||||||
printf("No change: file does not end with a newline\n");
|
printf("No change: requested removal would leave empty file\n");
|
||||||
return 1;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue