forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the date parsing accept pretty much any random crap.
This date parser turns line-noise into a date. Cool.
- Loading branch information
Linus Torvalds
committed
Apr 30, 2005
1 parent
3a6a23e
commit 8996702
Showing
3 changed files
with
238 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#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\n", argv[i], result, ctime(&t)); | ||
} | ||
return 0; | ||
} |