From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] DEL code in file name
Date: Sat, 9 Mar 2013 09:12:40 -0500 [thread overview]
Message-ID: <c4d896f804a41d50b8f894d4e4f4fd57@brasstown.quanstro.net> (raw)
In-Reply-To: <18ADB858-4CC7-4A12-8408-57552185113E@ar.aichi-u.ac.jp>
i would think that a more complete solution
would be something like this. (not tested)
0xff isn't delete, and isn't valid utf. 0x7f is
valid utf, but also not useful in a file name.
- erik
int
checkname(char *s)
{
int i, n;
Rune c;
if(s == nil || *s == 0)
return Ename;
if(*s == '.' && (s[1] == 0 || (s[1] == '.' && s[2] == 0)))
return Edot;
for(i = 0;; i += n) {
n = chartorune(&r, s);
if(i+n >= NAMELEN)
return Etoolong;
if(r == 0)
return 0;
if(n == 1 && r == Runeerror)
return Ename;
if(r <= 040 || r == 0x7f)
return Ename;
}
}
next prev parent reply other threads:[~2013-03-09 14:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-09 13:38 arisawa
2013-03-09 14:12 ` erik quanstrom [this message]
2013-03-09 23:41 ` arisawa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4d896f804a41d50b8f894d4e4f4fd57@brasstown.quanstro.net \
--to=quanstro@quanstro.net \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).