X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fuserspec.c;h=6e58b486c7ed9e50ead5b9df56733945c85a9a93;hb=22c1c15d0a29a1b7ea75456abe3f7062f835c887;hp=88b43a1310bef83530d98bf9222c6504c2df5232;hpb=48dbf2c191cd60b64354849d8e0a8fe4a7d613f2;p=gnulib.git diff --git a/lib/userspec.c b/lib/userspec.c index 88b43a131..6e58b486c 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -32,27 +32,15 @@ # include #endif -#if HAVE_LIMITS_H -# include -#endif - -#if HAVE_STRING_H -# include -#else -# include -# ifndef strchr -# define strchr index -# endif -#endif - -#if STDC_HEADERS -# include -#endif +#include +#include +#include #if HAVE_UNISTD_H # include #endif +#include "posixver.h" #include "xalloc.h" #include "xstrtol.h" @@ -74,10 +62,6 @@ struct group *getgrgid (); # define endpwent() ((void) 0) #endif -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif - /* The extra casts work around common compiler bugs. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The outer cast is needed to work around a bug in Cray C 5.0.3.0. @@ -185,7 +169,7 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, separator = strchr (spec, ':'); /* If there is no colon, then see if there's a `.'. */ - if (separator == NULL) + if (separator == NULL && posix2_version () < 200112) { dot = strchr (spec, '.'); /* If there's no colon but there is a `.', then first look up the