shithub: riscv

Download patch

ref: d7684982e83e8ec333df07d9910deefb70724979
parent: c9a1045d499a2ef5330ee056abb94254a1052d0b
author: cinap_lenrek <[email protected]>
date: Fri May 24 13:25:44 EDT 2019

awk: no need to call getargv() twice to get the value for FILENAME

--- a/sys/src/cmd/awk/lib.c
+++ b/sys/src/cmd/awk/lib.c
@@ -88,7 +88,7 @@
 
 	for (i = 1; i < *AARGC; i++) {
 		if (!isclvar(p = getargv(i))) {	/* find 1st real filename */
-			setsval(lookup("FILENAME", symtab), getargv(i));
+			setsval(lookup("FILENAME", symtab), p);
 			return;
 		}
 		setclvar(p);	/* a commandline assignment before filename */