Removed
Link Here
|
1 |
--- ftpfs-ls.c.orig Tue Dec 12 11:09:37 2006 |
2 |
+++ ftpfs-ls.c Tue Dec 12 11:09:42 2006 |
3 |
@@ -6,7 +6,12 @@ |
4 |
See the file COPYING. |
5 |
*/ |
6 |
|
7 |
+#ifndef __FreeBSD__ |
8 |
#define _XOPEN_SOURCE 600 |
9 |
+#else |
10 |
+#define _XOPEN_SOURCE |
11 |
+#endif |
12 |
+ |
13 |
#include <time.h> |
14 |
#include <string.h> |
15 |
#include <sys/types.h> |
16 |
@@ -27,7 +32,7 @@ |
17 |
long nlink = 1; |
18 |
char user[33]; |
19 |
char group[33]; |
20 |
- long size; |
21 |
+ unsigned long long size; |
22 |
char month[4]; |
23 |
char day[3]; |
24 |
char year[6]; |
25 |
@@ -42,25 +47,25 @@ |
26 |
|
27 |
#define SPACES "%*[ \t]" |
28 |
res = sscanf(line, |
29 |
- "%11s" SPACES |
30 |
+ "%11s" |
31 |
"%lu" SPACES |
32 |
"%32s" SPACES |
33 |
"%32s" SPACES |
34 |
- "%lu" SPACES |
35 |
+ "%llu" SPACES |
36 |
"%3s" SPACES |
37 |
"%2s" SPACES |
38 |
- "%5s" SPACES |
39 |
+ "%5s" "%*c" |
40 |
"%1023c", |
41 |
mode, &nlink, user, group, &size, month, day, year, file); |
42 |
if (res < 9) { |
43 |
res = sscanf(line, |
44 |
- "%11s" SPACES |
45 |
+ "%11s" |
46 |
"%32s" SPACES |
47 |
"%32s" SPACES |
48 |
- "%lu" SPACES |
49 |
+ "%llu" SPACES |
50 |
"%3s" SPACES |
51 |
"%2s" SPACES |
52 |
- "%5s" SPACES |
53 |
+ "%5s" "%*c" |
54 |
"%1023c", |
55 |
mode, user, group, &size, month, day, year, file); |
56 |
if (res < 8) { |
57 |
@@ -156,7 +161,7 @@ |
58 |
if (!strcmp(size, "<DIR>")) { |
59 |
sbuf->st_mode |= S_IFDIR; |
60 |
} else { |
61 |
- int nsize = strtol(size, NULL, 0); |
62 |
+ unsigned long long nsize = strtoull(size, NULL, 0); |
63 |
sbuf->st_mode |= S_IFREG; |
64 |
sbuf->st_size = nsize; |
65 |
if (ftpfs.blksize) { |