diff options
author | Eric Blake <eblake@redhat.com> | 2010-09-08 08:49:15 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-09-08 08:50:20 -0600 |
commit | 28a948d4a051659556d86b676e8bdf4a3a444966 (patch) | |
tree | 62ca3d639ed8987ebac90a7acd469da2ba9cf158 /m4/getopt.m4 | |
parent | 37a7671494e1ffe25fc2058ba122bb85ae824090 (diff) | |
download | gnulib-28a948d4a051659556d86b676e8bdf4a3a444966.tar.gz |
getopt: optimize previous patch
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Correctly check for
empty variable. Speed up awk script.
Reported by Paolo Bonzini.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'm4/getopt.m4')
-rw-r--r-- | m4/getopt.m4 | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 720f0482ae..d05e9d9143 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,4 +1,4 @@ -# getopt.m4 serial 30 +# getopt.m4 serial 31 dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -218,9 +218,8 @@ main () # so take care to revert to the correct (non-)export state. dnl GNU Coding Standards currently allow awk but not env; besides, env dnl is ambiguous with environment values that contain newlines. - gl_awk_probe='BEGIN { for (v in ENVIRON) - if (v == "POSIXLY_CORRECT") print "x" }' - case ${POSIXLY_CORRECT:+x}`$AWK "$gl_awk_probe" </dev/null` in + gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' + case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in xx) gl_had_POSIXLY_CORRECT=exported ;; x) gl_had_POSIXLY_CORRECT=yes ;; *) gl_had_POSIXLY_CORRECT= ;; |