git: 9front

Download patch

ref: 27f5f4399b62515ff78c0c3142c0ef67eb0d75c3
parent: bd958dfe896084917f22e1abe9688ca276e6eeac
author: aiju <devnull@localhost>
date: Thu Sep 15 05:13:22 EDT 2016

pc(1): _ handling in numbers was broken at some point; restore documented behaviour

--- a/sys/src/cmd/pc.y
+++ b/sys/src/cmd/pc.y
@@ -527,7 +527,7 @@
 	if(c == '\n') prompted = 0;
 	if(isdigit(c)){
 		for(p = buf, *p++ = c; c = Bgetc(in), isalnum(c) || c == '_'; )
-			if(p < buf + sizeof(buf) - 1)
+			if(p < buf + sizeof(buf) - 1 && c != '_')
 				*p++ = c;
 		*p = 0;
 		Bungetc(in);
--