Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: net/base/net_util.cc

Issue 8970023: FTP: work around server bugs resulting in negative file size being sent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/ftp/ftp_directory_listing_parser_ls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
===================================================================
--- net/base/net_util.cc (revision 114696)
+++ net/base/net_util.cc (working copy)
@@ -1411,7 +1411,11 @@
result.append(",0,");
}
- base::JsonDoubleQuote(FormatBytesUnlocalized(size), true, &result);
+ // Negative size means unknown or not applicable (e.g. directory).
+ string16 size_string;
+ if (size >= 0)
+ size_string = FormatBytesUnlocalized(size);
+ base::JsonDoubleQuote(size_string, true, &result);
result.append(",");
« no previous file with comments | « no previous file | net/ftp/ftp_directory_listing_parser_ls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698