Nmap Development mailing list archives

Re: Leading newlines in script output


From: David Fifield <david () bamsoftware com>
Date: Wed, 29 Sep 2010 22:04:38 -0700

On Wed, Sep 29, 2010 at 09:34:50PM -0500, Kris Katterjohn wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/2010 09:29 PM, David Fifield wrote:
The code in formatScriptOutput strips leading newlines from the output
(and my fix keeps it this way). I'm sure many script writers have been
annoyed by this. To force the first line of output to be on a line after
the script id, we have things like this:

scripts/asn-query.nse:  return (" \n%s"):format( table.concat( output, "\n" ) )
scripts/citrix-brute-xml.nse:   return " \n" .. result
scripts/qscan.nse:      return " \n" .. report(stats)

This trick of starting the output with whitespace to fool the newline
remover is also used in stdnse.format_output. I can't think of a reason
why we want newlines removed. Let's get rid of it?

Sounds good to me!

All done. I also updated " \n" in scripts where I found it.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: