Revision 3229 libsylph/procheader.c
| procheader.c (revision 3229) | ||
|---|---|---|
| 1 | 1 |
/* |
| 2 | 2 |
* LibSylph -- E-Mail client library |
| 3 |
* Copyright (C) 1999-2007 Hiroyuki Yamamoto
|
|
| 3 |
* Copyright (C) 1999-2013 Hiroyuki Yamamoto
|
|
| 4 | 4 |
* |
| 5 | 5 |
* This library is free software; you can redistribute it and/or |
| 6 | 6 |
* modify it under the terms of the GNU Lesser General Public |
| ... | ... | |
| 817 | 817 |
weekday, day, month, year, hh, mm, ss, zone); |
| 818 | 818 |
if (result == 8) return 0; |
| 819 | 819 |
|
| 820 |
result = sscanf(str, "%3s,%d %9s %d %2d.%2d.%2d %5s", |
|
| 821 |
weekday, day, month, year, hh, mm, ss, zone); |
|
| 822 |
if (result == 8) return 0; |
|
| 823 |
|
|
| 824 |
result = sscanf(str, "%3s %d, %9s %d %2d:%2d:%2d %5s", |
|
| 825 |
weekday, day, month, year, hh, mm, ss, zone); |
|
| 826 |
if (result == 8) return 0; |
|
| 827 |
|
|
| 820 | 828 |
result = sscanf(str, "%d %9s %d %2d:%2d:%2d %5s", |
| 821 | 829 |
day, month, year, hh, mm, ss, zone); |
| 822 | 830 |
if (result == 7) return 0; |
| ... | ... | |
| 830 | 838 |
day, month, year, hh, mm, ss); |
| 831 | 839 |
if (result == 6) return 0; |
| 832 | 840 |
|
| 841 |
result = sscanf(str, "%d-%2s-%2d %2d:%2d:%2d", |
|
| 842 |
year, month, day, hh, mm, ss); |
|
| 843 |
if (result == 6) return 0; |
|
| 844 |
|
|
| 833 | 845 |
*ss = 0; |
| 834 | 846 |
result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s", |
| 835 | 847 |
weekday, day, month, year, hh, mm, zone); |
| ... | ... | |
| 839 | 851 |
day, month, year, hh, mm, zone); |
| 840 | 852 |
if (result == 6) return 0; |
| 841 | 853 |
|
| 842 |
*zone = '\0'; |
|
| 843 |
result = sscanf(str, "%d-%2s-%2d %2d:%2d:%2d", |
|
| 844 |
year, month, day, hh, mm, ss); |
|
| 845 |
if (result == 6) return 0; |
|
| 846 |
|
|
| 847 | 854 |
result = sscanf(str, "%10s %d %9s %d %2d:%2d", |
| 848 | 855 |
weekday, day, month, year, hh, mm); |
| 849 | 856 |
if (result == 6) return 0; |
| ... | ... | |
| 872 | 879 |
|
| 873 | 880 |
if (procheader_scan_date_string(src, weekday, &day, month, &year, |
| 874 | 881 |
&hh, &mm, &ss, zone) < 0) {
|
| 882 |
g_warning("procheader_scan_date_string: date parse failed: %s", src);
|
|
| 875 | 883 |
if (dest && len > 0) |
| 876 | 884 |
strncpy2(dest, src, len); |
| 877 | 885 |
return 0; |
Also available in: Unified diff