you're welcome.
however, i don't think kanji space shouldn't be quoted.
the purpose of the function is to determine if the string needs quoting for
rc's benefit. (there are a number of space characters and other
potentially-confusing
stuff in unicode that rc does not interpret as whitespace.)
the function you're looking for could be called "needshumanquote" and
could be written like this
int
needshumanquote(int r)
{
if(r <= ' ')
return 1;
if(r < 0x80 && strchr("`^#*[]=|\\?${}()'<>&;", r))
return 1;
if(!isalpharune(r))
return 1;
return 0;
}
a better version of this function could be written with the a function
isspacerune. (i've got a script which generates this table from
UnicodeData.txt.)
there's a patch for needsrcquote in /n/sources/patch/needsrcquote.
- erik
On Fri Jul 28 07:42:06 CDT 2006, [EMAIL PROTECTED] wrote:
> Hello,
>
> > ; diff -c /n/sources/plan9/sys/src/libc/port/needsrcquote.c
> > needsrcquote.c
> > /n/sources/plan9/sys/src/libc/port/needsrcquote.c:6,12 -
> > needsrcquote.c:6,12
> > {
> > if(c <= ' ')
> > return 1;
> > - if(strchr("`^#*[]=|\\?${}()'<>&;", c))
> > + if(c < 0x80 && strchr("`^#*[]=|\\?${}()'<>&;", c))
> > return 1;
> > return 0;
> > }
> >
> > - erik
>
> Thanks eric. That works.
>
> I think kanji space (0x3000) should be quoted. Therefore
> - if(c <= ' ')
> + if(c <= ' ' || c == 0x3000)
> is desirable
>
> I hope official needsrcquote.c is to be changed along the patch by
> eric and me.
>
> Kenji Arisawa