|
23 | 23 |
|
24 | 24 | int main(int argc, char **argv) |
25 | 25 | { |
26 | | - FILE* EntriesFile = fopen(".svn\\entries", "r"); |
| 26 | + FILE* EntriesFile = fopen(".svn/entries", "r"); |
27 | 27 | if(!EntriesFile) |
28 | | - { |
29 | | - fclose(EntriesFile); |
30 | 28 | return 1; |
31 | | - } |
32 | 29 |
|
33 | 30 | char buf[200]; |
34 | 31 | int revision; |
35 | 32 | char date_str[200]; |
36 | 33 | char time_str[200]; |
37 | 34 |
|
38 | 35 | fgets(buf,200,EntriesFile); |
39 | | - fgets(buf,200,EntriesFile); |
40 | | - fgets(buf,200,EntriesFile); |
41 | | - fscanf(EntriesFile,"%i",&revision); |
42 | | - fgets(buf,200,EntriesFile); |
43 | | - fgets(buf,200,EntriesFile); |
44 | | - fgets(buf,200,EntriesFile); |
45 | | - fgets(buf,200,EntriesFile); |
46 | | - fgets(buf,200,EntriesFile); |
47 | | - fscanf(EntriesFile,"%10sT%8s",date_str,time_str); |
| 36 | + if (strstr(buf,"xml") > 0) |
| 37 | + { // svn 1.3.x |
| 38 | + fgets(buf,200,EntriesFile); |
| 39 | + fgets(buf,200,EntriesFile); |
| 40 | + fgets(buf,200,EntriesFile); |
| 41 | + fgets(buf,200,EntriesFile); |
| 42 | + fgets(buf,200,EntriesFile); |
| 43 | + fscanf(EntriesFile," committed-date=\"%10sT%8s",date_str,time_str); |
| 44 | + fgets(buf,200,EntriesFile); |
| 45 | + fgets(buf,200,EntriesFile); |
| 46 | + fgets(buf,200,EntriesFile); |
| 47 | + fgets(buf,200,EntriesFile); |
| 48 | + fgets(buf,200,EntriesFile); |
| 49 | + fgets(buf,200,EntriesFile); |
| 50 | + fscanf(EntriesFile," revision=\"%i",&revision); |
| 51 | + } else |
| 52 | + { // svn 1.4.x |
| 53 | + fgets(buf,200,EntriesFile); |
| 54 | + fgets(buf,200,EntriesFile); |
| 55 | + fscanf(EntriesFile,"%i",&revision); |
| 56 | + fgets(buf,200,EntriesFile); |
| 57 | + fgets(buf,200,EntriesFile); |
| 58 | + fgets(buf,200,EntriesFile); |
| 59 | + fgets(buf,200,EntriesFile); |
| 60 | + fgets(buf,200,EntriesFile); |
| 61 | + fscanf(EntriesFile,"%10sT%8s",date_str,time_str); |
| 62 | + } |
48 | 63 |
|
49 | 64 | std::ostringstream newData; |
50 | 65 |
|
|
0 commit comments