OLD | NEW |
1 /* Portions are Copyright (C) 2011 Google Inc */ | 1 /* Portions are Copyright (C) 2011 Google Inc */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 SKIP_MORE: | 1036 SKIP_MORE: |
1037 while (*rest && | 1037 while (*rest && |
1038 (*rest == ' ' || *rest == '\t' || | 1038 (*rest == ' ' || *rest == '\t' || |
1039 *rest == ',' || *rest == ';' || *rest == '/' || | 1039 *rest == ',' || *rest == ';' || *rest == '/' || |
1040 *rest == '(' || *rest == ')' || *rest == '[' || *rest
== ']')) | 1040 *rest == '(' || *rest == ')' || *rest == '[' || *rest
== ']')) |
1041 rest++; | 1041 rest++; |
1042 | 1042 |
1043 /* "-" is ignored at the beginning of a token if we have not yet | 1043 /* "-" is ignored at the beginning of a token if we have not yet |
1044 parsed a year (e.g., the second "-" in "30-AUG-1966"), or if | 1044 parsed a year (e.g., the second "-" in "30-AUG-1966"), or if |
1045 the character after the dash is not a digit. */ | 1045 the character after the dash is not a digit. */ |
1046 if (*rest == '-' && ((rest > string && isalpha(rest[-1]) && year < 0) | 1046 if (*rest == '-' && ((rest > string && |
1047 || rest[1] < '0' || rest[1] > '9')) | 1047 isalpha((unsigned char)rest[-1]) && year < 0) || |
| 1048 rest[1] < '0' || rest[1] > '9')) |
1048 { | 1049 { |
1049 rest++; | 1050 rest++; |
1050 goto SKIP_MORE; | 1051 goto SKIP_MORE; |
1051 } | 1052 } |
1052 | 1053 |
1053 } | 1054 } |
1054 | 1055 |
1055 if (zone != TT_UNKNOWN && zone_offset == -1) | 1056 if (zone != TT_UNKNOWN && zone_offset == -1) |
1056 { | 1057 { |
1057 switch (zone) | 1058 switch (zone) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 + 60 * localTime.tm_hour | 1201 + 60 * localTime.tm_hour |
1201 + 1440 * (localTime.tm_mday - 2); | 1202 + 1440 * (localTime.tm_mday - 2); |
1202 } | 1203 } |
1203 | 1204 |
1204 result->tm_params.tp_gmt_offset = zone_offset * 60; | 1205 result->tm_params.tp_gmt_offset = zone_offset * 60; |
1205 result->tm_params.tp_dst_offset = dst_offset * 60; | 1206 result->tm_params.tp_dst_offset = dst_offset * 60; |
1206 | 1207 |
1207 *result_imploded = PR_ImplodeTime(result); | 1208 *result_imploded = PR_ImplodeTime(result); |
1208 return PR_SUCCESS; | 1209 return PR_SUCCESS; |
1209 } | 1210 } |
OLD | NEW |