Fossil

Check-in [b2fdf4fe]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b2fdf4fe143516126091186adb69c564ed7ced43
User & Date: drh 2009-10-01 17:22:46
References
2009-10-31
15:09 Fixed ticket [3f0c73f2]: diff-command with parameter doesn't work plus 2 other changes artifact: eb787985 user: drh
Context
2009-10-04
18:29
Remember the userid and password used to clone so that subsequent syncs work correctly. check-in: 4dbc8a6d user: drh tags: trunk
2009-10-01
17:22
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. check-in: b2fdf4fe user: drh tags: trunk
14:54
Add a missing $baseurl to the default header. check-in: 631c52bc user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/diffcmd.c.

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
    }else{
      zExternalCommand = db_get("gdiff-command", 0);
    }
    if( zExternalCommand==0 ){
      internalDiff=1;
    }else{
      blob_zero(&cmd);
      shell_escape(&cmd, zExternalCommand);
      blob_append(&cmd, " ", 1);
    }
  }
  zFile = g.argv[g.argc-1];
  file_tree_name(zFile, &fname, 1);

  blob_zero(&vname);
  do{
................................................................................
    printf("--- %s\n+++ %s\n", blob_str(&fname), blob_str(&fname));
    printf("%s\n", blob_str(&out));
    blob_reset(&current);
    blob_reset(&out);
  }else{
    blob_write_to_file(&record, blob_str(&vname));
    blob_reset(&record);
    shell_escape(&cmd, blob_str(&vname));
    blob_appendf(&cmd, " ");
    shell_escape(&cmd, zFile);
    portable_system(blob_str(&cmd));
    unlink(blob_str(&vname));
    blob_reset(&vname);
    blob_reset(&cmd);
  }
  blob_reset(&fname);







|
<







 







<
|







169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
...
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
    }else{
      zExternalCommand = db_get("gdiff-command", 0);
    }
    if( zExternalCommand==0 ){
      internalDiff=1;
    }else{
      blob_zero(&cmd);
      blob_appendf(&cmd,"%s ",zExternalCommand);

    }
  }
  zFile = g.argv[g.argc-1];
  file_tree_name(zFile, &fname, 1);

  blob_zero(&vname);
  do{
................................................................................
    printf("--- %s\n+++ %s\n", blob_str(&fname), blob_str(&fname));
    printf("%s\n", blob_str(&out));
    blob_reset(&current);
    blob_reset(&out);
  }else{
    blob_write_to_file(&record, blob_str(&vname));
    blob_reset(&record);

    blob_appendf(&cmd, "%s ", blob_str(&vname));
    shell_escape(&cmd, zFile);
    portable_system(blob_str(&cmd));
    unlink(blob_str(&vname));
    blob_reset(&vname);
    blob_reset(&cmd);
  }
  blob_reset(&fname);