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.
Commit
b2fdf4fe143516126091186adb69c564ed7ced43
Parent
631c52bc96367bd…
1 file changed
+2
-4
+2
-4
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -171,12 +171,11 @@ | ||
| 171 | 171 | } |
| 172 | 172 | if( zExternalCommand==0 ){ |
| 173 | 173 | internalDiff=1; |
| 174 | 174 | }else{ |
| 175 | 175 | blob_zero(&cmd); |
| 176 | - shell_escape(&cmd, zExternalCommand); | |
| 177 | - blob_append(&cmd, " ", 1); | |
| 176 | + blob_appendf(&cmd,"%s ",zExternalCommand); | |
| 178 | 177 | } |
| 179 | 178 | } |
| 180 | 179 | zFile = g.argv[g.argc-1]; |
| 181 | 180 | file_tree_name(zFile, &fname, 1); |
| 182 | 181 | |
| @@ -207,12 +206,11 @@ | ||
| 207 | 206 | blob_reset(¤t); |
| 208 | 207 | blob_reset(&out); |
| 209 | 208 | }else{ |
| 210 | 209 | blob_write_to_file(&record, blob_str(&vname)); |
| 211 | 210 | blob_reset(&record); |
| 212 | - shell_escape(&cmd, blob_str(&vname)); | |
| 213 | - blob_appendf(&cmd, " "); | |
| 211 | + blob_appendf(&cmd, "%s ", blob_str(&vname)); | |
| 214 | 212 | shell_escape(&cmd, zFile); |
| 215 | 213 | portable_system(blob_str(&cmd)); |
| 216 | 214 | unlink(blob_str(&vname)); |
| 217 | 215 | blob_reset(&vname); |
| 218 | 216 | blob_reset(&cmd); |
| 219 | 217 |
| --- 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(¤t); |
| 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(¤t); |
| 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 |