View | Details | Raw Unified | Return to bug 227861 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-cmds__command.c (+11 lines)
Line 0 Link Here
1
--- cmds_command.c.orig	2018-08-03 06:04:39 UTC
2
+++ cmds_command.c
3
@@ -826,7 +826,7 @@ void do_commandmode(struct block * sb) {
4
             exec_cmd(line);
5
 
6
         } else if ( inputline[0] == L'w' ) {
7
-            if (savefile() == 0 && ! wcscmp(inputline, L"wq")) shall_quit = 1;
8
+            if (savefile() == 0 && ! wcsncmp(inputline, L"wq", 2)) shall_quit = 1;
9
 
10
         } else if ( ! wcsncmp(inputline, L"file ", 5) ) {
11
 
(-)files/patch-doc (+11 lines)
Line 0 Link Here
1
--- doc.orig	2018-08-03 06:09:42 UTC
2
+++ doc
3
@@ -328,6 +328,8 @@ Commands for handling cell content:
4
      :w {file}   Save the current spreadsheet as {file}.
5
      :w! {file}  Save the current spreadsheet as {file}, forcing an overwrite
6
                  if {file} already exists.
7
+     :wq         Save the current spreadsheet and quit SC-IM.
8
+     :wq {file}  Save the current spreadsheet as {file} and quit SC-IM.
9
 
10
      :h          Show this help.
11
      :help       Show this help.
(-)files/patch-file.c (+16 lines)
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;

Return to bug 227861