diff mbox

[1/2] Fix typo in _REGEX_VERSION name

Message ID 20140912111245.GA28267@spoyarek.pnq.redhat.com
State New
Headers show

Commit Message

Siddhesh Poyarekar Sept. 12, 2014, 11:12 a.m. UTC
There is no _POSIX_REGEX_VERSION, so don't check for it.  Instead
check for what actually exists, which is _REGEX_VERSION.  I found this
when trying to make the getconf environment variables typo-proof.

	* sysdeps/posix/sysconf.c (__sysconf): Check for and return
	_REGEX_VERSION and not _POSIX_REGEX_VERSION.
---
 sysdeps/posix/sysconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Roland McGrath Sept. 12, 2014, 6:04 p.m. UTC | #1
_REGEX_VERSION is never defined and in fact it was removed from the
standard.  For backward compatibility we must support _SC_REGEX_VERSION and
return -1 without setting errno, but I don't think we should treat this
like the real cases any more.  That is, just unconditionally return -1
and a comment about it having been removed in 1003.1-2004.


Thanks,
Roland
diff mbox

Patch

diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index cd2fb5a..644f514 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -984,8 +984,8 @@  __sysconf (name)
       return -1;
 #endif
     case _SC_REGEX_VERSION:
-#if _POSIX_REGEX_VERSION > 0
-      return _POSIX_REGEX_VERSION;
+#ifdef _REGEX_VERSION
+      return _REGEX_VERSION;
 #else
       return -1;
 #endif