Lines 1-6
Link Here
|
1 |
--- ../src/chmview.c |
1 |
diff -ruN src.old/chmview.c src/chmview.c |
2 |
+++ chmview.c.new |
2 |
--- src.old/chmview.c 2005-03-07 21:29:18.000000000 +0100 |
3 |
@@ -17,16 +17,30 @@ |
3 |
+++ chmview.c 2008-08-18 14:39:39.000000000 +0200 |
|
|
4 |
@@ -17,19 +17,33 @@ |
4 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5 |
*/ |
6 |
*/ |
6 |
|
7 |
|
Lines 30-36
Link Here
|
30 |
+ |
31 |
+ |
31 |
struct cb_data |
32 |
struct cb_data |
32 |
{ |
33 |
{ |
33 |
int extractwithoutpath; |
34 |
- int extractwithoutpath; |
|
|
35 |
+ long extractwithoutpath; |
36 |
char *path; |
37 |
int pathlen; |
38 |
}; |
34 |
@@ -44,6 +58,7 @@ |
39 |
@@ -44,6 +58,7 @@ |
35 |
return p; |
40 |
return p; |
36 |
} |
41 |
} |
Lines 79-84
Link Here
|
79 |
|
84 |
|
80 |
const char ILLEGAL_SYMB[] = "<>:|?*\""; |
85 |
const char ILLEGAL_SYMB[] = "<>:|?*\""; |
81 |
const char ILLEGAL_REPL[] = "()_!__'"; |
86 |
const char ILLEGAL_REPL[] = "()_!__'"; |
|
|
87 |
@@ -94,7 +142,7 @@ |
88 |
} |
89 |
} |
90 |
|
91 |
-static int savetofile(struct chmFile *c, struct chmUnitInfo *ui, int extractwithoutpath) |
92 |
+static int savetofile(struct chmFile *c, struct chmUnitInfo *ui, long extractwithoutpath) |
93 |
{ |
94 |
LONGINT64 length=0; |
95 |
char *outbuf=NULL; |
82 |
@@ -103,6 +151,9 @@ |
96 |
@@ -103,6 +151,9 @@ |
83 |
char fullpath[CHM_MAX_PATHLEN*2+1]; |
97 |
char fullpath[CHM_MAX_PATHLEN*2+1]; |
84 |
char target[CHM_MAX_PATHLEN*2+1]; |
98 |
char target[CHM_MAX_PATHLEN*2+1]; |
Lines 122-128
Link Here
|
122 |
ReplaceIllegalChars(target); |
136 |
ReplaceIllegalChars(target); |
123 |
strcat(fullpath,extractwithoutpath?pointtoname(target):(target[0]=='/'?target+1:target)); |
137 |
strcat(fullpath,extractwithoutpath?pointtoname(target):(target[0]=='/'?target+1:target)); |
124 |
if (!extractwithoutpath) |
138 |
if (!extractwithoutpath) |
125 |
@@ -153,15 +223,19 @@ |
139 |
@@ -147,26 +217,30 @@ |
|
|
140 |
return 0; |
141 |
} |
142 |
|
143 |
-void extract(struct chmFile *c, struct chmUnitInfo *ui, int extractwithoutpath) |
144 |
+void extract(struct chmFile *c, struct chmUnitInfo *ui, long extractwithoutpath) |
145 |
{ |
146 |
char target[CHM_MAX_PATHLEN*2+1]; |
126 |
wchar_t temp[CHM_MAX_PATHLEN+1]; |
147 |
wchar_t temp[CHM_MAX_PATHLEN+1]; |
127 |
|
148 |
|
128 |
decode_UTF8(temp,ui->path); |
149 |
decode_UTF8(temp,ui->path); |
Lines 138-149
Link Here
|
138 |
error=1; |
159 |
error=1; |
139 |
//return CHM_ENUMERATOR_FAILURE; |
160 |
//return CHM_ENUMERATOR_FAILURE; |
140 |
- } |
161 |
- } |
141 |
- printf("OK\n"); |
|
|
142 |
+ } else |
162 |
+ } else |
143 |
+ printf("OK\n"); |
163 |
printf("OK\n"); |
144 |
} |
164 |
} |
145 |
|
165 |
|
146 |
int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui, void *context) |
166 |
int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui, void *context) |
|
|
167 |
{ |
168 |
- extract(c,ui,(int)context); |
169 |
+ extract(c,ui,(long)context); |
170 |
return CHM_ENUMERATOR_CONTINUE; |
171 |
} |
172 |
|
173 |
@@ -180,7 +254,7 @@ |
174 |
return CHM_ENUMERATOR_CONTINUE; |
175 |
} |
176 |
|
177 |
-extractdir(struct chmFile *c, char *path, int extractwithoutpath) |
178 |
+extractdir(struct chmFile *c, char *path, long extractwithoutpath) |
179 |
{ |
180 |
struct cb_data data = {extractwithoutpath,path,strlen(path)}; |
181 |
chm_enumerate(c,CHM_ENUMERATE_ALL,_extract_callback_dir,(void *)&data); |
147 |
@@ -193,7 +267,11 @@ |
182 |
@@ -193,7 +267,11 @@ |
148 |
wchar_t temp[CHM_MAX_PATHLEN+1]; |
183 |
wchar_t temp[CHM_MAX_PATHLEN+1]; |
149 |
|
184 |
|
Lines 166-171
Link Here
|
166 |
c = chm_open(infname); |
201 |
c = chm_open(infname); |
167 |
if (!c) |
202 |
if (!c) |
168 |
exit(-1); |
203 |
exit(-1); |
|
|
204 |
@@ -265,7 +346,7 @@ |
205 |
char target[CHM_MAX_PATHLEN*2+1]; |
206 |
wchar_t temp[CHM_MAX_PATHLEN+1]; |
207 |
int status; |
208 |
- int extractwithoutpath = command[0]=='e'?1:0; |
209 |
+ long extractwithoutpath = command[0]=='e'?1:0; |
210 |
|
211 |
if (argc == 4) |
212 |
{ |
169 |
@@ -305,7 +386,11 @@ |
213 |
@@ -305,7 +386,11 @@ |
170 |
strcat(target,name+1); |
214 |
strcat(target,name+1); |
171 |
else |
215 |
else |