Menu

#18 ^M bug with tkdiff

v1.0 (example)
closed-fixed
None
5
2018-06-06
2005-01-20
Anonymous
No

I've reported a bug in ^M handeling in kompare, and juste saw that
tkdiff is also affected while xemacs and vim -d aren't

See the following URL for explanation and example.

http://bugs.kde.org/show_bug.cgi?id=97530

Discussion

  • Nobody/Anonymous

    I've located the source of the problem, at least for Linux (and presumably other
    Unix machines). If the ^M precedes a number, the internal workings of tkdiff
    assume that it is derived from the `diff` output. I have a fix to the code,
    in "proc run-command":

    Instead of:
    set failed [catch "$cmd \"2>$errfile\"" stdout]
    do the following:
    regsub "^exec " $cmd "" cmd_noexec
    set fl [open "| $cmd_noexec \"2>$errfile\""]
    fconfigure $fl -translation lf
    set stdout [read $fl]
    set failed [catch {close $fl}]

    This is the first time I've programmed in tcl, so I apologize if I missed
    something, but I've tested this fix and it does indeed handle imbedded ^M
    characters correctly (for Unix derivations, it was unclear to me that the
    -translation option to fconfigure would work on other machines).

    Hope this helps,

    Marc Pack
    marc.pack@computer.org

     
  • michael-m

    michael-m - 2018-06-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     I've reported a bug in ^M handeling in kompare, and juste saw that 
     tkdiff is also affected while xemacs and vim -d aren't 
    
    • status: open --> closed-fixed
    • assigned_to: michael-m
    • Group: --> v1.0 (example)
     
  • michael-m

    michael-m - 2018-06-06

    Right idea - just wrong place in the code to fix. Repaired in V4.3

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.