about summary refs log tree commit diff
path: root/Src/Builtins/rlimits.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Builtins/rlimits.c')
-rw-r--r--Src/Builtins/rlimits.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 8b664e36a..29f97b41d 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -610,14 +610,16 @@ bin_limit(char *nam, char **argv, Options ops, UNUSED(int func))
 		return 1;
 	    }
 	} else {
-	    /* memory-type resource -- `k' and `M' modifiers are permitted,
-	    meaning (respectively) 2^10 and 2^20. */
+	    /* memory-type resource -- `k', `M' and `G' modifiers are *
+	     * permitted, meaning (respectively) 2^10, 2^20 and 2^30. */
 	    val = zstrtorlimt(s, &s, 10);
 	    if (!*s || ((*s == 'k' || *s == 'K') && !s[1])) {
 		if (val != RLIM_INFINITY)
 		    val *= 1024L;
 	    } else if ((*s == 'M' || *s == 'm') && !s[1])
 		val *= 1024L * 1024;
+	    else if ((*s == 'G' || *s == 'g') && !s[1])
+		val *= 1024L * 1024 * 1024;
 	    else {
 		zwarnnam(nam, "unknown scaling factor: %s", s);
 		return 1;