Fossil SCM

Fix the "gdiff" command so that it accepts commands with arguments. This will require users to put double-quotes around program pathnames that contain spaces.

drh 2009-10-01 17:22 trunk
Commit b2fdf4fe143516126091186adb69c564ed7ced43
1 file changed +2 -4
+2 -4
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,12 +171,11 @@
171171
}
172172
if( zExternalCommand==0 ){
173173
internalDiff=1;
174174
}else{
175175
blob_zero(&cmd);
176
- shell_escape(&cmd, zExternalCommand);
177
- blob_append(&cmd, " ", 1);
176
+ blob_appendf(&cmd,"%s ",zExternalCommand);
178177
}
179178
}
180179
zFile = g.argv[g.argc-1];
181180
file_tree_name(zFile, &fname, 1);
182181
@@ -207,12 +206,11 @@
207206
blob_reset(&current);
208207
blob_reset(&out);
209208
}else{
210209
blob_write_to_file(&record, blob_str(&vname));
211210
blob_reset(&record);
212
- shell_escape(&cmd, blob_str(&vname));
213
- blob_appendf(&cmd, " ");
211
+ blob_appendf(&cmd, "%s ", blob_str(&vname));
214212
shell_escape(&cmd, zFile);
215213
portable_system(blob_str(&cmd));
216214
unlink(blob_str(&vname));
217215
blob_reset(&vname);
218216
blob_reset(&cmd);
219217
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,12 +171,11 @@
171 }
172 if( zExternalCommand==0 ){
173 internalDiff=1;
174 }else{
175 blob_zero(&cmd);
176 shell_escape(&cmd, zExternalCommand);
177 blob_append(&cmd, " ", 1);
178 }
179 }
180 zFile = g.argv[g.argc-1];
181 file_tree_name(zFile, &fname, 1);
182
@@ -207,12 +206,11 @@
207 blob_reset(&current);
208 blob_reset(&out);
209 }else{
210 blob_write_to_file(&record, blob_str(&vname));
211 blob_reset(&record);
212 shell_escape(&cmd, blob_str(&vname));
213 blob_appendf(&cmd, " ");
214 shell_escape(&cmd, zFile);
215 portable_system(blob_str(&cmd));
216 unlink(blob_str(&vname));
217 blob_reset(&vname);
218 blob_reset(&cmd);
219
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,12 +171,11 @@
171 }
172 if( zExternalCommand==0 ){
173 internalDiff=1;
174 }else{
175 blob_zero(&cmd);
176 blob_appendf(&cmd,"%s ",zExternalCommand);
 
177 }
178 }
179 zFile = g.argv[g.argc-1];
180 file_tree_name(zFile, &fname, 1);
181
@@ -207,12 +206,11 @@
206 blob_reset(&current);
207 blob_reset(&out);
208 }else{
209 blob_write_to_file(&record, blob_str(&vname));
210 blob_reset(&record);
211 blob_appendf(&cmd, "%s ", blob_str(&vname));
 
212 shell_escape(&cmd, zFile);
213 portable_system(blob_str(&cmd));
214 unlink(blob_str(&vname));
215 blob_reset(&vname);
216 blob_reset(&cmd);
217

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button