Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added %F to lognames, to support ISO date format #1979

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/man-xlate/nmap-de.1
Expand Up @@ -1625,7 +1625,10 @@ entspricht
%H%M%S,
%R
entspricht
%H%M
%H%M.
%F
entspricht
%Y-%m-%d
und
%D
entspricht
Expand Down
3 changes: 2 additions & 1 deletion docs/man-xlate/nmap-man-de.xml
Expand Up @@ -3384,7 +3384,8 @@ Umwandlungen im Dateinamen. <literal>%H</literal>, <literal>%M</literal>,
<literal>%y</literal> und <literal>%Y</literal> sind alle exakt gleich
wie in <function>strftime</function>. <literal>%T</literal> entspricht
<literal>%H%M%S</literal>, <literal>%R</literal> entspricht
<literal>%H%M</literal> und <literal>%D</literal> entspricht
<literal>%H%M</literal>, <literal>%F</literal> entspricht
<literal>%Y-%m-%d</literal> und <literal>%D</literal> entspricht
<literal>%m%d%y</literal>. Ein <literal>%</literal>, dem ein anderes Zeichen
folgt, ergibt nur genau dieses Zeichen (<literal>%%</literal> ergibt ein
Prozentzeichen). Also erzeugt <option>-oX 'scan-%T-%D.xml'</option> eine
Expand Down
5 changes: 4 additions & 1 deletion docs/nmap.1
Expand Up @@ -1978,7 +1978,10 @@ is the same as
%H%M%S,
%R
is the same as
%H%M, and
%H%M,
%F
is the same as
%Y-%m-%d, and
%D
is the same as
%m%d%y\&. A
Expand Down
3 changes: 2 additions & 1 deletion docs/refguide.xml
Expand Up @@ -3709,7 +3709,8 @@ conversions in the filename. <literal>%H</literal>, <literal>%M</literal>,
<literal>%y</literal>, and <literal>%Y</literal> are all exactly the same
as in <function>strftime</function>. <literal>%T</literal> is the same
as <literal>%H%M%S</literal>, <literal>%R</literal> is the same as
<literal>%H%M</literal>, and <literal>%D</literal> is the same as
<literal>%H%M</literal>, <literal>%F</literal> is the same as
<literal>%Y%m%d</literal>, and <literal>%D</literal> is the same as
<literal>%m%d%y</literal>. A <literal>%</literal> followed by any other
character just yields that character (<literal>%%</literal> gives you a
percent symbol). So <option>-oX 'scan-%T-%D.xml'</option> will use an XML
Expand Down
7 changes: 5 additions & 2 deletions output.cc
Expand Up @@ -935,8 +935,8 @@ void printportoutput(Target *currenths, PortList *plist) {

char *logfilename(const char *str, struct tm *tm) {
char *ret, *end, *p;
char tbuf[10];
int retlen = strlen(str) * 6 + 1;
char tbuf[11];
int retlen = strlen(str) * 8 + 1;

ret = (char *) safe_malloc(retlen);
end = ret + retlen;
Expand Down Expand Up @@ -979,6 +979,9 @@ char *logfilename(const char *str, struct tm *tm) {
case 'D':
strftime(tbuf, sizeof tbuf, "%m%d%y", tm);
break;
case 'F':
strftime(tbuf, sizeof tbuf, "%Y-%m-%d", tm);
break;
default:
*p++ = *str;
continue;
Expand Down