From ac487c754e009b0f3c01c2a8ad5bda2143da4a6b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Dec 2020 14:42:47 -0500 Subject: acme: allow @ in file names For upspin and other tools that put email addresses in names. --- src/cmd/acme/look.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/acme') diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c index 35667c6c..a7172b50 100644 --- a/src/cmd/acme/look.c +++ b/src/cmd/acme/look.c @@ -378,7 +378,7 @@ search(Text *ct, Rune *r, uint n) int isfilec(Rune r) { - static Rune Lx[] = { '.', '-', '+', '/', ':', 0 }; + static Rune Lx[] = { '.', '-', '+', '/', ':', '@', 0 }; if(isalnum(r)) return TRUE; if(runestrchr(Lx, r)) -- cgit v1.2.3 From 1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 5 Jan 2021 23:38:09 -0500 Subject: 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. --- src/cmd/acme/edit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cmd/acme') 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 '#': -- cgit v1.2.3