--- nmap/nmap.cc +++ nmap/nmap.cc @@ -2691,8 +2691,6 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) { int res; int foundsomething = 0; struct passwd *pw; - char dot_buffer[512]; - static int warningcount = 0; std::map::iterator iter; /* First, check the map of requested data file names. If there's an entry for @@ -2773,6 +2771,9 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) { } } +#ifdef ENABLE_DOT_DIR_OPEN + char dot_buffer[512]; + static int warningcount = 0; if (foundsomething && (*filename_returned != '.')) { res = Snprintf(dot_buffer, sizeof(dot_buffer), "./%s", file); if (res > 0 && res < bufferlen) { @@ -2793,6 +2794,7 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) { foundsomething = fileexistsandisreadable(filename_returned); } } +#endif /* ENABLE_DOT_DIR_OPEN */ if (!foundsomething) { filename_returned[0] = '\0';