1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-08 15:39:05 +00:00
dmiller 930bc91359 Modify stdnse.output_table to handle empty values better
Two changes here, both minor. First, explicitly assigning a new key to
nil does not add the key to the ordered set of keys. This better
emulates the behavior of regular tables.

> o = stdnse.output_table()
> o["test"] = nil

This previously resulted in output like this:

|_ test: nil

Now it simply omits the "test:" key.

Second, I needed a way to tell whether an output table was empty or not.
Since Lua's next() function doesn't call the __pairs metamethod, it was
always returning nil. Instead, I used the __call metamethod, since it
had the least preexisting semantic meaning:

> o = stdnse.output_table()
> =o()
false
> o["test"] = 1
> =o()
true
2013-05-06 18:39:54 +00:00
2013-02-14 23:32:52 +00:00
2013-05-02 14:59:06 +00:00
2013-05-03 05:59:54 +00:00
2012-12-23 08:35:32 +00:00
2013-05-03 21:31:02 +00:00
2013-05-03 21:25:53 +00:00
2013-05-04 23:12:36 +00:00
2013-04-12 17:29:35 +00:00
2013-05-05 10:45:08 +00:00
2012-11-06 05:52:40 +00:00
2012-12-06 02:34:28 +00:00
2013-01-08 04:28:01 +00:00
2012-12-06 02:25:46 +00:00
2013-01-22 23:40:16 +00:00
2012-05-27 08:53:32 +00:00
2008-07-31 14:18:21 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2012-09-15 17:56:17 +00:00
2013-02-09 22:46:47 +00:00
2012-12-22 06:02:34 +00:00
2013-02-26 04:34:28 +00:00
2013-02-26 04:34:28 +00:00

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).
Languages
C 37.8%
Lua 28.1%
C++ 16.7%
Shell 5.8%
Python 4.2%
Other 7.2%