adjust optstring for GNU getopt()

This commit is contained in:
Georg Sauthoff 2016-08-21 16:41:57 +02:00
parent 43a5295e69
commit 9180a40f1f

View file

@ -922,9 +922,18 @@ read_command_options(register int argc, register char **argv)
extern char *optarg;
extern int optind, opterr, optopt;
// Apparently, the semantics of a leading '-' in the optstring differ
// between Solaris and GNU libc.
// Also, the '+' is probably a good idea for GNU libc to avoid
// reording of arguments.
#if defined(sun) || defined(__sun)
#define SUNPRO_CMD_OPTS "-~Bbc:Ddef:g:ij:K:kM:m:NnO:o:PpqRrSsTtuVvwx:"
#define SVR4_CMD_OPTS "-c:ef:g:ij:km:nO:o:pqrsTtVv"
#else
#define SUNPRO_CMD_OPTS "+~Bbc:Ddef:g:ij:K:kM:m:NnO:o:PpqRrSsTtuVvwx:"
#define SVR4_CMD_OPTS "+c:ef:g:ij:km:nO:o:pqrsTtVv"
#endif
/*
* Added V in SVR4_CMD_OPTS also, which is going to be a hidden