shithub: riscv

Download patch

ref: f4617dc7db28cd75e73bbe0044aa6bfc6941bfe5
parent: db0f050d2b65a5fe329cf9454720420cb2deb721
author: aiju <[email protected]>
date: Wed Jul 13 10:38:49 EDT 2011

fixed bug in sed

--- a/sys/src/cmd/sed.c
+++ b/sys/src/cmd/sed.c
@@ -688,9 +688,11 @@
 {
 	if (type == P_ARG)
 		prog.curr = name;
-	else if ((prog.bp = Bopen(name, OREAD)) == 0)
-		quit("Cannot open pattern-file: %s\n", name);
-	Blethal(prog.bp, nil);
+	else {
+		if ((prog.bp = Bopen(name, OREAD)) == 0)
+			quit("Cannot open pattern-file: %s\n", name);
+		Blethal(prog.bp, nil);
+	}
 	prog.type = type;
 }