Nmap Development mailing list archives

Re: format_output question


From: Ron <ron () skullsecurity net>
Date: Wed, 13 Jan 2010 14:38:54 -0600

Hi Patrik,

That definitely appears to be a bug, but I can't reproduce it. I copied and pasted your code into this function:

action = function(host, port)
    local a = {}
    local a2 = {}

    table.insert(a, "Level 1 - Item 1")
    table.insert(a2, "Level 2 - Item 1")
    table.insert(a2, "Level 2 - Item 2")
    table.insert( a, a2 )

    return stdnse.format_output(true, a)
end


And the response is:

| test:
|   Level 1 - Item 1
|     Level 2 - Item 1
|_    Level 2 - Item 2

Is there some other circumstance, perhaps?

On 01/13/2010 02:16 PM, Patrik Karlsson wrote:
Hi

I'm looking into some output issues I'm having in two of my scripts and noticed the following:

table.insert(a, "Level 1 - Item 1")
table.insert(a2, "Level 2 - Item 1")
table.insert(a2, "Level 2 - Item 2")
table.insert( a, a2 )
return stdnse.format_output(true, a)

produces the following output

| test:
|   Level 1 - Item 1
|     Level 2 - Item 1
|_   Level 2 - Item 2

while the following code (having only one item at Level2)

table.insert(a, "Level 1 - Item 1")
table.insert(a2, "Level 2 - Item 1")
table.insert( a, a2 )
return stdnse.format_output(true, a)

produces the following output, depending on your font settings it may be difficult to see but the Level 2 item is not 
indented properly and is more to the left than Level 1.

| test:
|   Level 1 - Item 1
|_Level 2 - Item 1

Is this the way it should work or a bug?

//Patrik

Hmm, that looks like it might be a bug. I tested it pretty good, when I first wrote it, but we've made some changes since then.
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: