| 1367 |
if (count_only) |
if (count_only) |
| 1368 |
{ |
{ |
| 1369 |
if (count > 0 || !omit_zero_count) |
if (count > 0 || !omit_zero_count) |
| 1370 |
{ |
{ |
| 1371 |
if (printname != NULL && filenames != FN_NONE) |
if (printname != NULL && filenames != FN_NONE) |
| 1372 |
fprintf(stdout, "%s:", printname); |
fprintf(stdout, "%s:", printname); |
| 1373 |
fprintf(stdout, "%d\n", count); |
fprintf(stdout, "%d\n", count); |
| 1374 |
} |
} |
| 1375 |
} |
} |
| 1376 |
|
|
| 1377 |
return rc; |
return rc; |
| 1936 |
{ |
{ |
| 1937 |
char *opbra = strchr(op->long_name, '('); |
char *opbra = strchr(op->long_name, '('); |
| 1938 |
char *equals = strchr(op->long_name, '='); |
char *equals = strchr(op->long_name, '='); |
| 1939 |
|
|
| 1940 |
/* Handle options with only one spelling of the name */ |
/* Handle options with only one spelling of the name */ |
| 1941 |
|
|
| 1942 |
if (opbra == NULL) /* Does not contain '(' */ |
if (opbra == NULL) /* Does not contain '(' */ |
| 1943 |
{ |
{ |
| 1944 |
if (equals == NULL) /* Not thing=data case */ |
if (equals == NULL) /* Not thing=data case */ |
| 1961 |
} |
} |
| 1962 |
} |
} |
| 1963 |
} |
} |
| 1964 |
|
|
| 1965 |
/* Handle options with an alternate spelling of the name */ |
/* Handle options with an alternate spelling of the name */ |
| 1966 |
|
|
| 1967 |
else |
else |
| 1968 |
{ |
{ |
| 1969 |
char buff1[24]; |
char buff1[24]; |
| 1970 |
char buff2[24]; |
char buff2[24]; |
| 1971 |
|
|
| 1972 |
int baselen = opbra - op->long_name; |
int baselen = opbra - op->long_name; |
| 1973 |
int fulllen = strchr(op->long_name, ')') - op->long_name + 1; |
int fulllen = strchr(op->long_name, ')') - op->long_name + 1; |
| 1974 |
int arglen = (argequals == NULL || equals == NULL)? |
int arglen = (argequals == NULL || equals == NULL)? |
| 1975 |
(int)strlen(arg) : argequals - arg; |
(int)strlen(arg) : argequals - arg; |
| 1976 |
|
|
| 1977 |
sprintf(buff1, "%.*s", baselen, op->long_name); |
sprintf(buff1, "%.*s", baselen, op->long_name); |
| 1978 |
sprintf(buff2, "%s%.*s", buff1, fulllen - baselen - 2, opbra + 1); |
sprintf(buff2, "%s%.*s", buff1, fulllen - baselen - 2, opbra + 1); |
| 1979 |
|
|
| 1980 |
if (strncmp(arg, buff1, arglen) == 0 || |
if (strncmp(arg, buff1, arglen) == 0 || |
| 1981 |
strncmp(arg, buff2, arglen) == 0) |
strncmp(arg, buff2, arglen) == 0) |
| 1982 |
{ |
{ |
| 1983 |
if (equals != NULL && argequals != NULL) |
if (equals != NULL && argequals != NULL) |
| 1984 |
{ |
{ |
| 1985 |
option_data = argequals; |
option_data = argequals; |
| 1986 |
if (*option_data == '=') |
if (*option_data == '=') |
| 1987 |
{ |
{ |
| 1988 |
option_data++; |
option_data++; |
| 1989 |
longopwasequals = TRUE; |
longopwasequals = TRUE; |
| 1990 |
} |
} |
| 1991 |
} |
} |
| 1992 |
break; |
break; |
| 1993 |
} |
} |
| 1994 |
} |
} |
| 1995 |
} |
} |
| 1996 |
|
|