mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
Grab a more-complete Npcap version string
This commit is contained in:
parent
6b64fc4753
commit
91032d05dd
1 changed files with 12 additions and 3 deletions
15
nmap.cc
15
nmap.cc
|
|
@ -3232,11 +3232,20 @@ static void display_nmap_version() {
|
|||
#endif
|
||||
|
||||
const char *pcap_version = pcap_lib_version();
|
||||
#ifdef PCAP_INCLUDED
|
||||
with.push_back(std::string("nmap-") + get_word_or_quote(pcap_version, 0) + std::string("-") + get_word_or_quote(pcap_version, 2));
|
||||
#ifdef WIN32
|
||||
const char *pcap_num = strstr(pcap_version, "version ");
|
||||
if (pcap_num) {
|
||||
pcap_num += strlen("version ");
|
||||
}
|
||||
std::string pcap_num_str (pcap_num, strchr(pcap_num, ',') - pcap_num);
|
||||
#else
|
||||
with.push_back(get_word_or_quote(pcap_version, 0) + std::string("-") + get_word_or_quote(pcap_version, 2));
|
||||
std::string pcap_num_str = get_word_or_quote(pcap_version, 2);
|
||||
#endif
|
||||
with.push_back(
|
||||
#ifdef PCAP_INCLUDED
|
||||
std::string("nmap-") +
|
||||
#endif
|
||||
get_word_or_quote(pcap_version, 0) + std::string("-") + pcap_num_str);
|
||||
|
||||
#ifdef DNET_INCLUDED
|
||||
with.push_back(std::string("nmap-libdnet-") + DNET_VERSION);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue