From 48b37ff7d26efe4c3fbbf156ea7a3b386b00af33 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sun, 22 Nov 2009 08:22:54 +0000 Subject: [PATCH] Change script output indenting from one space to two --- nselib/stdnse.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index ac5180580..2f1f04ec7 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -268,14 +268,14 @@ local function format_get_indent(indent, at_end) local had_continue = false if(not(at_end)) then - str = rep(' ', #indent) -- Was: "| " + str = rep(' ', #indent) -- Was: "| " else for i = #indent, 1, -1 do if(indent[i] and not(had_continue)) then - str = str .. " " -- Was: "|_ " + str = str .. " " -- Was: "|_ " else had_continue = true - str = str .. " " -- Was: "| " + str = str .. " " -- Was: "| " end end end @@ -370,12 +370,12 @@ function format_output(status, data, indent) if(type(value) == 'table') then if(value['name']) then if(value['warning'] and nmap.debugging() > 0) then - output = output .. format("%s %s%s (WARNING: %s)\n", format_get_indent(indent), prefix, value['name'], value['warning']) + output = output .. format("%s %s%s (WARNING: %s)\n", format_get_indent(indent), prefix, value['name'], value['warning']) else - output = output .. format("%s %s%s\n", format_get_indent(indent), prefix, value['name']) + output = output .. format("%s %s%s\n", format_get_indent(indent), prefix, value['name']) end elseif(value['warning'] and nmap.debugging() > 0) then - output = output .. format("%s %s(WARNING: %s)\n", format_get_indent(indent), prefix, value['warning']) + output = output .. format("%s %s(WARNING: %s)\n", format_get_indent(indent), prefix, value['warning']) end -- Do a shallow copy of indent @@ -394,9 +394,9 @@ function format_output(status, data, indent) elseif(type(value) == 'string') then if(i ~= #data) then - output = output .. format("%s %s%s\n", format_get_indent(indent, false), prefix, value) + output = output .. format("%s %s%s\n", format_get_indent(indent, false), prefix, value) else - output = output .. format("%s %s%s\n", format_get_indent(indent, true), prefix, value) + output = output .. format("%s %s%s\n", format_get_indent(indent, true), prefix, value) end end end