shithub: riscv

Download patch

ref: 76812c9bb71193b7a9a4d059890915535ef49441
parent: 8a7f897b30780dbf9b733fa413d679140fd1c27a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Nov 13 06:03:37 EST 2018

rcpu: fix pvar to initialize empty variables (thanks mycroftiv)

--- a/rc/bin/rconnect
+++ b/rc/bin/rconnect
@@ -10,7 +10,8 @@
 
 fn pvar {
 	while(! ~ $#* 0){
-		~ $#$1 0 || path=/dev/null builtin whatis $1
+		~ $#$1 0 && echo $1'=()' ||
+			path=/dev/null builtin whatis $1
 		shift
 	}
 }
--- a/rc/bin/rcpu
+++ b/rc/bin/rcpu
@@ -76,7 +76,8 @@
 
 fn pvar {
 	while(! ~ $#* 0){
-		~ $#$1 0 || path=/dev/null builtin whatis $1
+		~ $#$1 0 && echo $1'=()' ||
+			path=/dev/null builtin whatis $1
 		shift
 	}
 }
--- a/rc/bin/rexport
+++ b/rc/bin/rexport
@@ -49,7 +49,8 @@
 
 fn pvar {
 	while(! ~ $#* 0){
-		~ $#$1 0 || path=/dev/null builtin whatis $1
+		~ $#$1 0 && echo $1'=()' ||
+			path=/dev/null builtin whatis $1
 		shift
 	}
 }
--- a/rc/bin/rimport
+++ b/rc/bin/rimport
@@ -44,7 +44,8 @@
 
 fn pvar {
 	while(! ~ $#* 0){
-		~ $#$1 0 || path=/dev/null builtin whatis $1
+		~ $#$1 0 && echo $1'=()' ||
+			path=/dev/null builtin whatis $1
 		shift
 	}
 }