projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
first try at implementing getdate function
[musl]
/
src
/
time
/
strptime.c
diff --git
a/src/time/strptime.c
b/src/time/strptime.c
index
d9481d1
..
4c0bb26
100644
(file)
--- a/
src/time/strptime.c
+++ b/
src/time/strptime.c
@@
-18,6
+18,7
@@
char *strptime(const char *s, const char *f, struct tm *tm)
else if (*s != *f) return 0;
else s++;
f++;
else if (*s != *f) return 0;
else s++;
f++;
+ continue;
}
f++;
if (*f == '+') f++;
}
f++;
if (*f == '+') f++;
@@
-155,7
+156,7
@@
char *strptime(const char *s, const char *f, struct tm *tm)
if (*s == '+') s++;
else if (*s == '-') neg=1, s++;
if (!isdigit(*s)) return 0;
if (*s == '+') s++;
else if (*s == '-') neg=1, s++;
if (!isdigit(*s)) return 0;
- for (i=0; i<w && isdigit(*s); i++)
+ for (
*dest=
i=0; i<w && isdigit(*s); i++)
*dest = *dest * 10 + *s++ - '0';
if (neg) *dest = -*dest;
*dest -= adj;
*dest = *dest * 10 + *s++ - '0';
if (neg) *dest = -*dest;
*dest -= adj;
@@
-165,6
+166,7
@@
char *strptime(const char *s, const char *f, struct tm *tm)
ex = nl_langinfo(min+i);
len = strlen(ex);
if (strncasecmp(s, ex, len)) continue;
ex = nl_langinfo(min+i);
len = strlen(ex);
if (strncasecmp(s, ex, len)) continue;
+ s += len;
*dest = i % range;
break;
}
*dest = i % range;
break;
}