mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Show a nicer error message in Ndiff when an input file can't be opened.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [Ndiff] Show a nicer error message when an input file can't be
|
||||
loaded. Suggested by Derril Lucci, who also contributed a patch.
|
||||
|
||||
o Added a function that was missing from http-favicon.nse. Its absence
|
||||
would cause the error
|
||||
http-favicon.nse:141: variable 'dirname' is not declared
|
||||
|
||||
12
ndiff/ndiff
12
ndiff/ndiff
@@ -1193,10 +1193,14 @@ def main():
|
||||
filename_a = input_filenames[0]
|
||||
filename_b = input_filenames[1]
|
||||
|
||||
scan_a = Scan()
|
||||
scan_a.load_from_file(filename_a)
|
||||
scan_b = Scan()
|
||||
scan_b.load_from_file(filename_b)
|
||||
try:
|
||||
scan_a = Scan()
|
||||
scan_a.load_from_file(filename_a)
|
||||
scan_b = Scan()
|
||||
scan_b.load_from_file(filename_b)
|
||||
except Exception, e:
|
||||
print >> sys.stderr, u"Can't open file: %s" % str(e)
|
||||
sys.exit(EXIT_ERROR)
|
||||
|
||||
diff = ScanDiff(scan_a, scan_b)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user