Print this page
3141 strptime() doesn't support %t
*** 1,6 ****
--- 1,7 ----
/*
+ * Copyright (c) 2014 Gary Mills
* Copyright 2011, Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 1994 Powerdog Industries. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*** 213,225 ****
if (i > 60)
return (NULL);
tm->tm_sec = i;
}
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'H':
case 'I':
case 'k':
--- 214,223 ----
*** 247,259 ****
} else if (i > 12)
return (NULL);
tm->tm_hour = i;
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'p':
/*
* XXX This is bogus if parsed before hour-related
--- 245,254 ----
*** 317,329 ****
len--;
}
if (i > 53)
return (NULL);
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'w':
if (!isdigit(*buf))
return (NULL);
--- 312,321 ----
*** 332,355 ****
if (i > 6)
return (NULL);
tm->tm_wday = i;
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'e':
/*
* The %e format has a space before single digits
* which we need to skip.
*/
if (isspace(*buf))
buf++;
- /* FALLTHROUGH */
- case 'd':
/*
* The %e specifier is explicitly documented as not
* being zero-padded but there is no harm in allowing
* such padding.
*
--- 324,343 ----
if (i > 6)
return (NULL);
tm->tm_wday = i;
break;
+ case 'd':
case 'e':
/*
* The %e format has a space before single digits
* which we need to skip.
*/
if (isspace(*buf))
buf++;
/*
* The %e specifier is explicitly documented as not
* being zero-padded but there is no harm in allowing
* such padding.
*
*** 368,380 ****
if (i > 31)
return (NULL);
tm->tm_mday = i;
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'B':
case 'b':
case 'h':
--- 356,365 ----
*** 415,427 ****
if (i < 1 || i > 12)
return (NULL);
tm->tm_mon = i - 1;
- if (isspace(*buf))
- while (*ptr != NULL && !isspace(*ptr))
- ptr++;
break;
case 's':
{
char *cp;
--- 400,409 ----
*** 463,475 ****
if (i < 0)
return (NULL);
tm->tm_year = i;
- if (isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
- ptr++;
break;
case 'Z':
{
const char *cp = buf;
--- 445,454 ----
*** 519,528 ****
--- 498,512 ----
tm->tm_hour -= sign * (i / 100);
tm->tm_min -= sign * (i % 100);
*flagsp |= F_GMT;
}
break;
+ case 'n':
+ case 't':
+ while (isspace(*buf))
+ buf++;
+ break;
}
}
if (!recurse) {
if (buf && (*flagsp & F_GMT)) {