1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 20:09:02 +00:00

Remove the old optparse function; options must be specified with hyphens.

This commit is contained in:
dmiller
2018-02-20 17:37:47 +00:00
parent 23d95f5126
commit 01e7430797
5 changed files with 150 additions and 184 deletions

View File

@@ -501,12 +501,6 @@ long parse_long(const char *s, char **tail);
in the supplied buffer. Eg: 0.122MB, 10.322Kb or 128B. */
char *format_bytecount(unsigned long long bytes, char *buf, size_t buflen);
/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalent (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b);
/* Convert non-printable characters to replchar in the string */
void replacenonprintable(char *str, int strlength, char replchar);

View File

@@ -794,25 +794,6 @@ char *format_bytecount(unsigned long long bytes, char *buf, size_t buflen) {
return buf;
}
/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalent (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b) {
while(*a && *b) {
if (*a == '_' || *a == '-') {
if (*b != '_' && *b != '-')
return 1;
}
else if (*a != *b)
return 1;
a++; b++;
}
if (*a || *b)
return 1;
return 0;
}
/* Returns one if the file pathname given exists, is not a directory and
* is readable by the executing process. Returns two if it is readable
* and is a directory. Otherwise returns 0. */