aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2021-01-05 23:38:09 -0500
committerRuss Cox <rsc@swtch.com>2021-01-05 23:38:09 -0500
commit1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c (patch)
tree5b4c0a3ba8784251a08dc46ed3a8f23e6b48cc60 /src/cmd/acme
parent0a513e65607223d11ba94003256b13ef5779e7e8 (diff)
downloadplan9port-1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c.tar.gz
plan9port-1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c.tar.bz2
plan9port-1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c.zip
acme, sam, samterm: remove weird switch usage
For whatever reason all three of these programs contain switches like: switch(x) { case 1: if(cond) case 2: f(); } Like Duff's device, this is legal C but more obscure than it really needs to be. This commit assumes those are intended as written and simply writes them more clearly. I did consider that maybe they are mistakes, but in the case of sam/regexp.c, my rewrite in this commit matches the acme/regx.c that has been in plan9port since I added acme in 2003. (I didn't bother to dig up the old Plan 9 releases.) Assuming acme/regx.c has been correct for the past two decades, this commit should be correct too.
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/acme/edit.c b/src/cmd/acme/edit.c
index 81f80300..82a19b0d 100644
--- a/src/cmd/acme/edit.c
+++ b/src/cmd/acme/edit.c
@@ -635,9 +635,11 @@ simpleaddr(void)
case '.':
case '$':
case '\'':
- if(addr.type!='"')
+ if(addr.type=='"')
+ break;
+ /* fall through */
case '"':
- editerror("bad address syntax");
+ editerror("bad address syntax");
break;
case 'l':
case '#':