summaryrefslogtreecommitdiffstats
path: root/net/third_party
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:03:47 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:03:47 +0000
commit303bdcbbda3d59a6fb2c475a98a1ce4793ab1817 (patch)
tree66b29d8f62e6344b7b885268d8c3999a2bc67e89 /net/third_party
parent91332b626ed0625764b76ec108f5de24ea7c22ed (diff)
downloadchromium_src-303bdcbbda3d59a6fb2c475a98a1ce4793ab1817.zip
chromium_src-303bdcbbda3d59a6fb2c475a98a1ce4793ab1817.tar.gz
chromium_src-303bdcbbda3d59a6fb2c475a98a1ce4793ab1817.tar.bz2
Followup after http://codereview.chromium.org/201034 to correctly handle months.
TEST=none BUG=none Review URL: http://codereview.chromium.org/199082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/third_party')
-rw-r--r--net/third_party/parseftp/ParseFTPList.cpp3
-rw-r--r--net/third_party/parseftp/ParseFTPList.h5
-rw-r--r--net/third_party/parseftp/chromium.patch8
3 files changed, 16 insertions, 0 deletions
diff --git a/net/third_party/parseftp/ParseFTPList.cpp b/net/third_party/parseftp/ParseFTPList.cpp
index be099e1..6cfb6e6 100644
--- a/net/third_party/parseftp/ParseFTPList.cpp
+++ b/net/third_party/parseftp/ParseFTPList.cpp
@@ -162,6 +162,7 @@ int ParseFTPList(const char *line, struct list_state *state,
uint64 seconds = StringToInt64(p+1);
Time t = Time::FromTimeT(seconds);
t.LocalExplode(&(result->fe_time));
+ result->fe_time.month--;
}
}
}
@@ -1172,6 +1173,7 @@ int ParseFTPList(const char *line, struct list_state *state,
{
Time t = Time::Now();
t.LocalExplode(&(state->now_tm));
+ state->now_tm.month--;
state->now_tm_valid = true;
}
@@ -1640,6 +1642,7 @@ int ParseFTPList(const char *line, struct list_state *state,
{
Time t = Time::Now();
t.LocalExplode(&(state->now_tm));
+ state->now_tm.month--;
state->now_tm_valid = true;
}
result->fe_time.year = state->now_tm.year;
diff --git a/net/third_party/parseftp/ParseFTPList.h b/net/third_party/parseftp/ParseFTPList.h
index b11abdc..c7ff925 100644
--- a/net/third_party/parseftp/ParseFTPList.h
+++ b/net/third_party/parseftp/ParseFTPList.h
@@ -102,6 +102,11 @@
namespace net {
+/* WARNING: The 'month' field of base::Time::Exploded will be in range 0-11
+ * (0 = January) to match PRExplodedTime. The caller should add 1 to 'month'
+ * if it intends to use it.
+ */
+
struct list_state
{
void *magic; /* to determine if previously initialized */
diff --git a/net/third_party/parseftp/chromium.patch b/net/third_party/parseftp/chromium.patch
index 5659817..4021a34 100644
--- a/net/third_party/parseftp/chromium.patch
+++ b/net/third_party/parseftp/chromium.patch
@@ -37,6 +37,7 @@ index b9ffbdc..be099e1 100644
+ uint64 seconds = StringToInt64(p+1);
+ Time t = Time::FromTimeT(seconds);
+ t.LocalExplode(&(result->fe_time));
++ result->fe_time.month--;
}
}
}
@@ -234,6 +235,7 @@ index b9ffbdc..be099e1 100644
- PR_ExplodeTime((state->now_time), PR_LocalTimeParameters, &(state->now_tm) );
+ Time t = Time::Now();
+ t.LocalExplode(&(state->now_tm));
++ state->now_tm.month--;
+ state->now_tm_valid = true;
}
@@ -353,6 +355,7 @@ index b9ffbdc..be099e1 100644
- PR_ExplodeTime((state->now_time), PR_LocalTimeParameters, &(state->now_tm) );
+ Time t = Time::Now();
+ t.LocalExplode(&(state->now_tm));
++ state->now_tm.month--;
+ state->now_tm_valid = true;
}
- result->fe_time.tm_year = state->now_tm.tm_year;
@@ -395,6 +398,11 @@ index 30ef8a3..b11abdc 100644
+namespace net {
+
++/* WARNING: The 'month' field of base::Time::Exploded will be in range 0-11
++ * (0 = January) to match PRExplodedTime. The caller should add 1 to 'month'
++ * if it intends to use it.
++ */
++
struct list_state
{
void *magic; /* to determine if previously initialized */