Line 0
Link Here
|
|
|
1 |
--- file.c.orig 2017-12-13 17:48:59 UTC |
2 |
+++ file.c |
3 |
@@ -202,7 +202,12 @@ int savefile() { |
4 |
del_range_chars(name, 0, 1 + force_rewrite); |
5 |
wordexp(name, &p, 0); |
6 |
|
7 |
- if (! force_rewrite && p.we_wordv[0] && file_exists(p.we_wordv[0])) { |
8 |
+ if (wcslen(inputline) > 2 && (!p.we_wordv || !p.we_wordv[0])) { |
9 |
+ sc_error("Trailing space(s)"); |
10 |
+ return -1; |
11 |
+ } |
12 |
+ |
13 |
+ if (! force_rewrite && p.we_wordv && p.we_wordv[0] && file_exists(p.we_wordv[0])) { |
14 |
sc_error("File already exists. Use \"!\" to force rewrite."); |
15 |
wordfree(&p); |
16 |
return -1; |