]> git.pond.sub.org Git - empserver/commitdiff
edit: Treat blank interactive input like empty input
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 20 Jan 2013 22:38:40 +0000 (23:38 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:53:56 +0000 (19:53 +0200)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/geninput.pl
tests/actofgod/journal.log

index f003514f7d091ec108dae2f4480640059ffc2a4b..85103fa56b3c34688f09940fa38d3eacb76e06ac 100644 (file)
@@ -405,11 +405,9 @@ getin(char *buf, char **valp)
     p = getstarg(NULL, "%c xxxxx -- thing value : ", buf);
     if (!p)
        return -1;
-    if (!*p)
-       return 0;
     for (; isspace(*p); p++) ;
     if (!*p)
-       return -1;
+       return 0;
     thing = *p;
     for (; *p && !isspace(*p); p++) ;
     for (; isspace(*p); p++) ;
index 24881d8b35c9236587001a26a9ce9b68f9ab7ba8..56c9895f14cfe57159cf1a47cfeb66b85c662221 100755 (executable)
@@ -207,6 +207,7 @@ edit('sect', '1,5', 'm', 1, 'a', 1);
 
 # interactive edit
 iedit('sect', '3,5', 'm 2', 'a 1');
+iedit('sect', '5,5', ' ');
 
 # give
 give('2,6', 'l', $INT_MIN);
index 85a5076460df56851a8a124e378a811413a7e2a5..bab150780a82cc9a08228456125e86608a6cf590 100644 (file)
     Play#0 output Play#0 1 Mines <M>: 0
     Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
     Play#0 output Play#0 6 0 640
+    Play#0 input edit l 5,5
+    Play#0 command edit
+    Play#0 output Play#0 1 Location <L>: 5,5   Distribution sector <D>: 5,5
+    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
+    Play#0 output Play#0 1 own  oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail
+    Play#0 output Play#0 1   o   O   e   m   i   g   f   c   u   w   l   x   X   p     t    F     a
+    Play#0 output Play#0 1   1   1   0   0   0   0   0   0   0 100   0   0   0   0     0    0     0
+    Play#0 output Play#0 1 Mines <M>: 0
+    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
+    Play#0 output Play#0 4 %c xxxxx -- thing value : 
+    Play#0 input  
+    Play#0 output Play#0 1 Location <L>: 5,5   Distribution sector <D>: 5,5
+    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
+    Play#0 output Play#0 1 own  oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail
+    Play#0 output Play#0 1   o   O   e   m   i   g   f   c   u   w   l   x   X   p     t    F     a
+    Play#0 output Play#0 1   1   1   0   0   0   0   0   0   0 100   0   0   0   0     0    0     0
+    Play#0 output Play#0 1 Mines <M>: 0
+    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
+    Play#0 output Play#0 6 0 640
+    Play#0 input 
+    Play#0 output Play#0 6 0 640
     Play#0 input give l 2,6 -2147483648
     Play#0 command give
     Play#0 output Play#0 1 Only 0 given in 2,6