mirror of
https://github.com/git/git.git
synced 2024-11-17 14:34:49 +01:00
68849b5442
And be a bitmore careful about matching: if we don't recognize a word or a number, we skip the whole thing, rather than trying the next character in that word/number. Finally: since ctime() adds the final '\n', don't add another one in test-date.
20 lines
343 B
C
20 lines
343 B
C
#include <stdio.h>
|
|
#include <time.h>
|
|
|
|
#include "cache.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int i;
|
|
|
|
for (i = 1; i < argc; i++) {
|
|
char result[100];
|
|
time_t t;
|
|
|
|
memcpy(result, "bad", 4);
|
|
parse_date(argv[i], result, sizeof(result));
|
|
t = strtoul(result, NULL, 0);
|
|
printf("%s -> %s -> %s", argv[i], result, ctime(&t));
|
|
}
|
|
return 0;
|
|
}
|