mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 12:37:02 +00:00
optarg should be "extern char *" not "extern const char *".
This commit is contained in:
2
compat.h
2
compat.h
@ -470,7 +470,7 @@ extern int BSDopterr;
|
||||
extern int BSDoptind;
|
||||
extern int BSDoptopt;
|
||||
extern int BSDoptreset;
|
||||
extern const char *BSDoptarg;
|
||||
extern char *BSDoptarg;
|
||||
int BSDgetopt(int, char *const *, const char *);
|
||||
#define getopt(ac, av, o) BSDgetopt(ac, av, o)
|
||||
#define opterr BSDopterr
|
||||
|
@ -121,7 +121,7 @@ int opterr = 1; /* if error message should be printed */
|
||||
int optind = 1; /* index into parent argv vector */
|
||||
int optopt = '?'; /* character checked for validity */
|
||||
int optreset; /* reset getopt */
|
||||
const char *optarg; /* argument associated with option */
|
||||
char *optarg; /* argument associated with option */
|
||||
|
||||
#define PRINT_ERROR ((opterr) && (*options != ':'))
|
||||
|
||||
@ -134,7 +134,7 @@ const char *optarg; /* argument associated with option */
|
||||
#define BADARG ((*options == ':') ? (int)':' : (int)'?')
|
||||
#define INORDER (int)1
|
||||
|
||||
#define EMSG ""
|
||||
#define EMSG (char *)""
|
||||
|
||||
static int getopt_internal(int, char * const *, const char *,
|
||||
const struct option *, int *, int);
|
||||
@ -143,7 +143,7 @@ static int parse_long_options(char * const *, const char *,
|
||||
static int gcd(int, int);
|
||||
static void permute_args(int, int, int, char * const *);
|
||||
|
||||
static const char *place = EMSG; /* option letter processing */
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
|
||||
/* XXX: set optreset to 1 rather than these two */
|
||||
static int nonopt_start = -1; /* first non option argument (for permute) */
|
||||
@ -221,7 +221,7 @@ static int
|
||||
parse_long_options(char * const *nargv, const char *options,
|
||||
const struct option *long_options, int *idx, int short_too)
|
||||
{
|
||||
const char *current_argv, *has_equal;
|
||||
char *current_argv, *has_equal;
|
||||
size_t current_argv_len;
|
||||
int i, match;
|
||||
|
||||
|
Reference in New Issue
Block a user