shithub: riscv

Download patch

ref: 4d5fb6c357b641ef37850bd2f400c89a3ec5b326
parent: 6886164e34f8da60069ae1e13ce6032f9aac1678
author: ben <ben@rana>
date: Thu Apr 28 08:07:24 EDT 2016

fix printing a char from an empty string

--- a/sys/src/cmd/awk/run.c
+++ b/sys/src/cmd/awk/run.c
@@ -961,8 +961,9 @@
 					*p = '\0';
 				}
 			} else {
-				*p++ = getsval(x)[0];
-				*p = 0;
+				if((*p = getsval(x)[0]) != '\0')
+					p++;
+				*p = '\0';
 			}
 			break;
 		}