changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: rcpu: fix pvar to initialize empty variables (thanks mycroftiv)

changeset 6886: b3f02338356b
parent 6885: 8a51ca8204c1
child 6887: f1e9a71d650a
author: cinap_lenrek@felloff.net
date: Tue, 13 Nov 2018 11:03:37 +0100
files: rc/bin/rconnect rc/bin/rcpu rc/bin/rexport rc/bin/rimport
description: rcpu: fix pvar to initialize empty variables (thanks mycroftiv)
     1.1--- a/rc/bin/rconnect
     1.2+++ b/rc/bin/rconnect
     1.3@@ -10,7 +10,8 @@ fn usage {
     1.4 
     1.5 fn pvar {
     1.6 	while(! ~ $#* 0){
     1.7-		~ $#$1 0 || path=/dev/null builtin whatis $1
     1.8+		~ $#$1 0 && echo $1'=()' ||
     1.9+			path=/dev/null builtin whatis $1
    1.10 		shift
    1.11 	}
    1.12 }
     2.1--- a/rc/bin/rcpu
     2.2+++ b/rc/bin/rcpu
     2.3@@ -76,7 +76,8 @@ while(~ $1 -*){
     2.4 
     2.5 fn pvar {
     2.6 	while(! ~ $#* 0){
     2.7-		~ $#$1 0 || path=/dev/null builtin whatis $1
     2.8+		~ $#$1 0 && echo $1'=()' ||
     2.9+			path=/dev/null builtin whatis $1
    2.10 		shift
    2.11 	}
    2.12 }
     3.1--- a/rc/bin/rexport
     3.2+++ b/rc/bin/rexport
     3.3@@ -49,7 +49,8 @@ cmd=$*
     3.4 
     3.5 fn pvar {
     3.6 	while(! ~ $#* 0){
     3.7-		~ $#$1 0 || path=/dev/null builtin whatis $1
     3.8+		~ $#$1 0 && echo $1'=()' ||
     3.9+			path=/dev/null builtin whatis $1
    3.10 		shift
    3.11 	}
    3.12 }
     4.1--- a/rc/bin/rimport
     4.2+++ b/rc/bin/rimport
     4.3@@ -44,7 +44,8 @@ case *; usage
     4.4 
     4.5 fn pvar {
     4.6 	while(! ~ $#* 0){
     4.7-		~ $#$1 0 || path=/dev/null builtin whatis $1
     4.8+		~ $#$1 0 && echo $1'=()' ||
     4.9+			path=/dev/null builtin whatis $1
    4.10 		shift
    4.11 	}
    4.12 }