Fossil

Check-in [52199a50]
Login

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

Overview
Comment:Fix a segfault that occurs with the "fossil md5sum" command when files named on the command-line do not actually exist. Ticket [8ca2aae39172f90c].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 52199a504a9c7c20a4f7d9a71c32f3df0cabd404
User & Date: drh 2012-11-02 21:20:19
References
2012-11-04
21:36 Ticket [8ca2aae3] Command-line wildcards broken with Fossil 1.24 on Windows, in some cases crashing Fossil (1.23 was OK) status still Open with 1 other change artifact: 7f0f162d user: drh
Context
2012-11-02
21:33
Fix an out-of-order variable declaration in blob.c. check-in: 9073d8dc user: drh tags: trunk
21:20
Fix a segfault that occurs with the "fossil md5sum" command when files named on the command-line do not actually exist. Ticket [8ca2aae39172f90c]. check-in: 52199a50 user: drh tags: trunk
17:49
Make form field widths consistent for settings. Fix comment for the 'binary-glob' setting. check-in: c24b6890 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/md5.c.

431
432
433
434
435
436
437

438
439
440
441
442
443
444
445
446
447
*/
void md5sum_test(void){
  int i;
  Blob in;
  Blob cksum;
  
  for(i=2; i<g.argc; i++){

    if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
      blob_read_from_channel(&in, stdin, -1);
      md5sum_blob(&in, &cksum);
    }else{
      md5sum_file(g.argv[i], &cksum);
    }
    fossil_print("%s  %s\n", blob_str(&cksum), g.argv[i]);
    blob_reset(&cksum);
  }
}







>










431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
*/
void md5sum_test(void){
  int i;
  Blob in;
  Blob cksum;
  
  for(i=2; i<g.argc; i++){
    blob_init(&cksum, "********** not found ***********", -1);
    if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
      blob_read_from_channel(&in, stdin, -1);
      md5sum_blob(&in, &cksum);
    }else{
      md5sum_file(g.argv[i], &cksum);
    }
    fossil_print("%s  %s\n", blob_str(&cksum), g.argv[i]);
    blob_reset(&cksum);
  }
}