9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [Patch] acme open filenames with at
@ 2021-02-22 19:37 Philip Silva
  2021-03-02 21:09 ` [9front] " Philip Silva
  0 siblings, 1 reply; 2+ messages in thread
From: Philip Silva @ 2021-02-22 19:37 UTC (permalink / raw)
  To: 9front

Hi!

I've seen in plan9port there's a commit allowing @s in filenames:

commit ac487c754e009b0f3c01c2a8ad5bda2143da4a6b
Author: Russ Cox <rsc@swtch.com>
Date:   Wed Dec 30 14:42:47 2020 -0500

    acme: allow @ in file names

    For upspin and other tools that put email addresses in names.

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))

In the Go module paths this is used in path names actually to delimit the version. Here's a patch for this, would be great if it could get merged!

diff -r 318117d314ad sys/src/cmd/acme/look.c
--- a/sys/src/cmd/acme/look.c   Mon Feb 22 19:27:49 2021 +0100
+++ b/sys/src/cmd/acme/look.c   Mon Feb 22 20:23:07 2021 +0100
@@ -314,7 +314,7 @@ isfilec(Rune r)
 {
        if(isalnum(r))
                return TRUE;
-       if(runestrchr(L".-+/:", r))
+       if(runestrchr(L".-+/:@", r))
                return TRUE;
        return FALSE;
 }


Greetings, Philip

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 19:37 [9front] [Patch] acme open filenames with at Philip Silva
2021-03-02 21:09 ` [9front] " Philip Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).