tlib9: fix needsrcquote - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 1f1ab4ccbbec9c92b780f6a60ff9730126659a87
(DIR) parent 3ebbd193dce0724e106ec9af627a3782676ae510
(HTM) Author: Russ Cox <rsc@swtch.com>
Date: Mon, 19 Jun 2017 09:50:14 -0400
lib9: fix needsrcquote
As written, it is passing a rune to strchr, which likely ignores
all but the bottom 8 bits of the rune. Long-standing Plan 9 bug too.
Fixes #87.
Change-Id: I6a833373b308bed8760d6989972c7f77b4ef3838
Reviewed-on: https://plan9port-review.googlesource.com/2921
Reviewed-by: Russ Cox <rsc@swtch.com>
Diffstat:
M src/lib9/needsrcquote.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/src/lib9/needsrcquote.c b/src/lib9/needsrcquote.c
t@@ -4,7 +4,7 @@
int
needsrcquote(int c)
{
- if(c <= ' ')
+ if(c <= ' ' || c >= 0x80)
return 1;
if(strchr("`^#*[]=|\\?${}()'<>&;", c))
return 1;