# New Ticket Created by Ivan B. Serezhkin # Please include the string: [perl #53966] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53966 >
Hello. .sub _ :main load_bytecode 'Data/Dumper.pbc' .local pmc Dumper, str Dumper = find_global 'Data::Dumper', 'dumper' $I0 = time $S0 = gmtime $I0 str = new 'String' str = $S0 Dumper(str,str) .end Does this: "VAR1" => "Sat May 10 19:10:57 2008\n\x{0}" but must "VAR1" => "Sat May 10 19:35:57 2008\n" And there is another question: need we \n on the end of string ? -- Ivan B. Serezhkin
Index: src/ops/sys.ops =================================================================== --- src/ops/sys.ops (revision 27397) +++ src/ops/sys.ops (working copy) @@ -178,7 +178,7 @@ char resultbuffer[26]; Parrot_gmtime_r(&t, &tm); Parrot_asctime_r(&tm, resultbuffer); - $1 = string_from_cstring(interp, resultbuffer, 26); + $1 = string_from_cstring(interp, resultbuffer, strlen(resultbuffer)); } op localtime(out STR, in INT) { @@ -187,7 +187,7 @@ char resultbuffer[26]; Parrot_localtime_r(&t, &tm); Parrot_asctime_r(&tm, resultbuffer); - $1 = string_from_cstring(interp, resultbuffer, 26); + $1 = string_from_cstring(interp, resultbuffer, strlen(resultbuffer)); } op decodetime(out PMC, in INT) {