small fix - theedge

Chad Kittel vertigo at wi.rr.com
Thu Apr 15 22:00:24 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I know tchan will think I'm crazy and probably think it's pointless, but I'm 
gunna submit it anyway because I'm anal like that :o) Anyhow... if you do a 
'lvu newer/older X' and let X be anything other than a number that falls in 
the predefined range in the newer() and older() function you get a infinate 
loop of something like "/bin/lvu: line 320: [: JUNKVALUE: integer expression 
expected", that you have to Ctrl+C out of.  Below is a patch to fix that.  
This was against theedge dated 20040416.

@@ -304,7 +304,10 @@


 newer()  {
- -  [ -z "$1" ] && return 1
+  [ -z "$1" ] && return 1
+  if [ ! -z `echo $1 | sed 's/[[:digit:]]//g'` ] ; then
+    return 1
+  fi
   DATE=$1
   [ "$DATE" -lt "20010101" ] && return 1
   [ "$DATE" -gt "20310101" ] && return 1
@@ -318,7 +321,10 @@


 older()  {
- -  [ -z "$1" ] && return 1
+  [ -z "$1" ] && return 1
+  if [ ! -z `echo $1 | sed 's/[[:digit:]]//g'` ] ; then
+    return 1
+  fi
   DATE=$1
   [ "$DATE" -lt "20010101" ] && return 1
   [ "$DATE" -gt "20310101" ] && return 1

- - v3rt1g0

- -- 
Chad R. Kittel
 E-Mail: vertigo at wi.rr.com
 Running: Lunar-Linux (kernel: 2.6.5-mm3)

- ------------------------------------------------------
Pedaeration, n.:
	The perfect body heat achieved by having one leg under the
	sheet and one hanging off the edge of the bed.
		-- Rich Hall, "Sniglets"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAf0xI+j8p7lVzKmsRAmVUAJ4v7JMSw0QoCUfkOnS5aZ/JCrdTHACg2w0H
aR/XoxefajCFcSHKzoJ8tS4=
=B7YR
-----END PGP SIGNATURE-----


More information about the Lunar mailing list