changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: awk: no need to call getargv() twice to get the value for FILENAME

changeset 7255: 9e9a8e0c78f1
parent 7254: 03b53375c4f5
child 7256: ca43df3d5f56
author: cinap_lenrek@felloff.net
date: Fri, 24 May 2019 17:25:44 +0200
files: sys/src/cmd/awk/lib.c
description: awk: no need to call getargv() twice to get the value for FILENAME
     1.1--- a/sys/src/cmd/awk/lib.c
     1.2+++ b/sys/src/cmd/awk/lib.c
     1.3@@ -88,7 +88,7 @@ void initgetrec(void)
     1.4 
     1.5 	for (i = 1; i < *AARGC; i++) {
     1.6 		if (!isclvar(p = getargv(i))) {	/* find 1st real filename */
     1.7-			setsval(lookup("FILENAME", symtab), getargv(i));
     1.8+			setsval(lookup("FILENAME", symtab), p);
     1.9 			return;
    1.10 		}
    1.11 		setclvar(p);	/* a commandline assignment before filename */