Bugzilla bug 247896 and bug 331216: fixed the bug that 'end' was moved one NSPRPUB_PRE_4_2_CLIENT_BRANCH
authorwtchang%redhat.com
Tue, 11 Apr 2006 19:00:02 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 3633 9bb0274ccd5463e97eaebdb0c68f2887f13f58eb
parent 3625 5c2cd1e252dfcbfd2b257629ab40ddef6f0709c8
child 3637 0e3c2ab89bb799e639b5f9438719972cc603284d
push idunknown
push userunknown
push dateunknown
bugs247896, 331216
Bugzilla bug 247896 and bug 331216: fixed the bug that 'end' was moved one character too far when parsing the minutes, and simplified the code. r=timeless,darin. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
pr/src/misc/prtime.c
--- a/pr/src/misc/prtime.c
+++ b/pr/src/misc/prtime.c
@@ -1225,23 +1225,19 @@ PR_ParseTimeString(
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
                                 else if ((end - rest) == 2)
                                   tmp_hour = ((rest[0]-'0')*10 +
                                                           (rest[1]-'0'));
                                 else
                                   tmp_hour = (rest[0]-'0');
 
-                                while (*rest && *rest != ':')
-                                  rest++;
-                                rest++;
-
                                 /* move over the colon, and parse minutes */
 
-                                end = rest + 1;
+                                rest = ++end;
                                 while (*end >= '0' && *end <= '9')
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after first colon? */
                                   break;
                                 else if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */