From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <091279b578f15c44301b9e1e1c3f55f0@quanstro.net> From: erik quanstrom Date: Fri, 28 Jul 2006 07:48:58 -0500 To: 9fans@cse.psu.edu Subject: Re: [9fans] quote file name In-Reply-To: <92D74425-59CB-473D-90A9-CF49BCAC892D@ar.aichi-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 91d11dfa-ead1-11e9-9d60-3106f5b1d025 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, arisawa@ar.aichi-u.ac.jp 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