about summary refs log tree commit diff
path: root/Src/Builtins/rlimits.awk
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-16 17:45:26 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-16 17:45:26 +0000
commite2bd36d1a358ae75ccc1b01be4f9d43ee10868c6 (patch)
treea72d2e2c24f083cfacad823fdcab8e83efe81d8a /Src/Builtins/rlimits.awk
parent97c08895aadc54af80395e4c24517a8bc3fd51bc (diff)
downloadzsh-e2bd36d1a358ae75ccc1b01be4f9d43ee10868c6.tar.gz
zsh-e2bd36d1a358ae75ccc1b01be4f9d43ee10868c6.tar.xz
zsh-e2bd36d1a358ae75ccc1b01be4f9d43ee10868c6.zip
20816: update rlimits for new glibc
Diffstat (limited to 'Src/Builtins/rlimits.awk')
-rw-r--r--Src/Builtins/rlimits.awk10
1 files changed, 7 insertions, 3 deletions
diff --git a/Src/Builtins/rlimits.awk b/Src/Builtins/rlimits.awk
index e1a06fe2b..3258e077b 100644
--- a/Src/Builtins/rlimits.awk
+++ b/Src/Builtins/rlimits.awk
@@ -6,7 +6,7 @@
 #
 BEGIN {limidx = 0}
 
-/^[\t ]*(#[\t ]*define[\t _]*RLIMIT_[A-Z_]*[\t ]*[0-9][0-9]*|RLIMIT_[A-Z_]*,[\t ]*|RLIMIT_[A-Z_]*[\t ]*=[\t ]*[0-9][0-9]*,[\t ]*)/ {
+/^[\t ]*(#[\t ]*define[\t _]*RLIMIT_[A-Z_]*[\t ]*[0-9][0-9]*|RLIMIT_[A-Z_]*,[\t ]*|_*RLIMIT_[A-Z_]*[\t ]*=[\t ]*[0-9][0-9]*,[\t ]*)/ {
     limindex = index($0, "RLIMIT_")
     limtail = substr($0, limindex, 80)
     split(limtail, tmp)
@@ -19,7 +19,11 @@ BEGIN {limidx = 0}
 	limnam = substr(limnam, 1, limindex-1)
     }
     if (limnum == "=") {
-	limnum = limidx++
+	if (tmp[3] ~ /^[0-9]/) {
+	    limnum = tmp[3] + 0
+	} else {
+	    limnum = limidx++
+	}
 	limindex = index($0, ",")
 	limnam = substr(limnam, 1, limindex-1)
     }
@@ -60,7 +64,7 @@ BEGIN {limidx = 0}
 /^[\t ]*RLIM_NLIMITS[\t ]*=[\t ]*RLIMIT_NLIMITS/ {
     if(!nlimits) { nlimits = limidx }
 }
-/^[\t ]*RLIM(IT)?_NLIMITS[\t ]*=[\t ]*[0-9][0-9]*/ {
+/^[\t _]*RLIM(IT)?_NLIMITS[\t ]*=[\t ]*[0-9][0-9]*/ {
     limindex = index($0, "=")
     limtail = substr($0, limindex, 80)
     split(limtail, tmp)