Bug 69011

Summary: FTPDirectoryDocument Shows Garbled String for Last Modified Date
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2011-09-28 11:41:51 PDT
Opening ftp://ftp.oracle.com in a browser that uses WebCore's FTPDirectoryDocument
was including a semi-garbage incorrect string for the Last Modified Date.

It looks like this was due to a change that removed some string corrosion and
accidentally introduced pointer arithmetic: 
http://trac.webkit.org/changeset/86542/trunk/Source/WebCore/html/FTPDirectoryDocument.cpp

    dateString = months[month] + ' ' + String::number(fileTime.tm_mday) + ", " + String::number(fileTime.tm_year);

The first two pieces are (char* + char) instead of the desired (WTF::String + char) and result
in an unexpected prefix for dateString.

Patch to follow.
Comment 1 Joseph Pecoraro 2011-09-28 11:44:24 PDT
Typo, I meant: "coercion".
Comment 2 Joseph Pecoraro 2011-09-28 11:57:06 PDT
Created attachment 109043 [details]
[PATCH] Proposed Fix

I also switched from + ' ' to + " " which would have caused a compiler issue and help catch
this earlier, but if you want we can switch that space back to a char. The important part
was to force the first expr to be a WTF::String.
Comment 3 WebKit Review Bot 2011-09-28 13:17:42 PDT
Comment on attachment 109043 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 109043

Committed r96253: <http://trac.webkit.org/changeset/96253>
Comment 4 WebKit Review Bot 2011-09-28 13:17:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Joseph Pecoraro 2011-09-28 13:46:05 PDT
<rdar://problem/10173710>