ref: 6b67914c70505187e57a2d4090c1d1c615e3d34c
parent: 099743a232265951709b0e025f8260bc4c1e28b3
author: Michael Forney <mforney@mforney.org>
date: Sun Oct 30 00:34:44 EDT 2022
rc: make `flag f [+-]` clear status on success Otherwise, the old status will be retained, which may be non-empty if it follows an if command whose branch wasn't taken. This is problematic for scripts using -e.
--- a/sys/src/cmd/rc/simple.c
+++ b/sys/src/cmd/rc/simple.c
@@ -445,10 +445,12 @@
if(strlen(letter)==1){
if(strcmp(val, "+")==0){
flag[(unsigned char)letter[0]] = flagset;
+ setstatus("");
break;
}
if(strcmp(val, "-")==0){
flag[(unsigned char)letter[0]] = 0;
+ setstatus("");
break;
}
}
--
⑨