Ticket Change Details
Not logged in
Overview

Artifact ID: 8debe854495dba9acf9e3ace02eeb4f39471ea13
Ticket: 995a864c5adf79456808d8f2bcd44c4959f46136
Editor command fails with spaces
User & Date: mjanssen 2011-02-02 14:43:05
Changes

  1. comment changed to:
    The fix for bug [8d073be8808beaa7b614b6d489e729dfb51ac114] only seems to have fixed the issue for the gdiff command. If editor contains spaces, executing it still fails.
    
    <verbatim>
    C:\Docs\Projects\01. Lean SDMC>fossil commit
    c:/Program Files/Vim/vim73/gvim.exe "C:/<snipped>/ci-comment-5
    260D688DBC8.txt"
    'c:/Program' is not recognized as an internal or external command,
    operable program or batch file.
    c:\Docs\Bin\fossil.exe: editor aborted
    </verbatim>
    
    Diff below fixes this, but a better solution would probably be to extend the portable_system command to cover all uses of fossil_system
    
    --- src/checkin.c
    +++ src/checkin.c
    @@ -442,11 +442,11 @@
     #if defined(_WIN32)
       blob_add_cr(&text);
     #endif
       blob_write_to_file(&text, zFile);
       if( zEditor ){
    -    zCmd = mprintf("%s \"%s\"", zEditor, zFile);
    +    zCmd = mprintf("\"%s\" \"%s\"", zEditor, zFile);
         printf("%s\n", zCmd);
         if( fossil_system(zCmd) ){
           fossil_panic("editor aborted");
         }
         blob_reset(&text);
    
  2. foundin changed to: "b6a4e8592d58ead7878f4a072fc6c4da71c7ea97"
  3. private_contact changed to: "9e3254e6e3c2643cc148bab2d55f46bb4c0446f4"
  4. severity changed to: "Important"
  5. status changed to: "Open"
  6. title changed to: "Editor command fails with spaces"
  7. type changed to: "Code_Defect"