Menu

#1821 Command line arguments does not work for Cygwin file pattern

Branch_+_Trunk
closed-fixed
5
2009-02-28
2008-12-14
No

The following fails on Cygwin:

winmergeu /c/aaa.txt /c/bbb.txt

Merging those two files on Winmerge by selecting them in file explorer works, of course.

Running the following:

winmergeu /c/aaa.txt ccc.txt

Opens Winmerge window with a ccc.txt in the 'Left' pane, and the 'Right' pane is empty.

Discussion

  • Kimmo Varis

    Kimmo Varis - 2008-12-14

    Can you tell the WinMerge version number?

     
  • Tomer Shalev

    Tomer Shalev - 2008-12-15

    It's WinMerge 2.10.2.0

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-15

    Ok, I'll look into this.

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-15
    • assigned_to: nobody --> kimmov
     
  • Kimmo Varis

    Kimmo Varis - 2008-12-15

    Ok, it needed simply replace of '/' with '\' in command line handler for paths.

    The patch (also attached):

    Index: Src/MergeCmdLineInfo.cpp

    --- Src/MergeCmdLineInfo.cpp (revision 6170)
    +++ Src/MergeCmdLineInfo.cpp (working copy)
    @@ -207,11 +207,16 @@
    {
    String param;
    bool flag;
    +
    while ((q = EatParam(q, param, &flag)) != 0)
    {
    if (!flag)
    {
    - // Not a flag
    + // Its not a flag so it is a path
    + // Convert paths given in Linux-style ('/' as separator) given from
    + // Cygwin to Windows style ('\' as separator)
    + string_replace(param, String(_T("/")), String(_T("\\")));
    +
    // If shortcut, expand it first
    if (paths_IsShortcut(param.c_str()))
    param = ExpandShortcut(param.c_str());

    File Added: cygwin_paths.patch

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-15

    The patch

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-16

    Fix committed to SVN trunk:
    Completed: At revision: 6175

    I'll commit this fix also to 2.10 branch. So next WinMerge release(s) will have this bug fixed.

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-16
    • milestone: --> Branch_+_Trunk
    • status: open --> open-fixed
     
  • Kimmo Varis

    Kimmo Varis - 2008-12-17

    I've now committed the fix to 2.10 branch too:
    Completed: At revision: 6179

    So the next 2.10.4 stable release will have this bug fixed. I'm hoping 2.10.4 release happens in begin of January...

    Thanks a lot for reporting this bug!

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-17
    • status: open-fixed --> closed-fixed
     
  • Tomer Shalev

    Tomer Shalev - 2008-12-22

    Doesn't work in 2.11.1.8, which is later than 2008-12-17...
    Shouldn't it be fixed in this version?

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22
    • status: closed-fixed --> open-fixed
     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Yes, 2.11.1.8 has the fix I made. And I tested it by opening few URLs from cygwin prompt. Can you give examples of paths that don't work, perhaps I overlooked something...

    Reopening.

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Ugh. I meant paths, not URLs...

     
  • Tomer Shalev

    Tomer Shalev - 2008-12-22

    A trivial example which doesn't work:
    $ winmergeu /c/JavaRa.log /c/AUTOEXEC.BAT

    This doesn't work either from Cygwin shell or CMD shell.

    I've upgraded to 2.11.1.8 from 2.10.2.0, without restarting. Is that a possible cause (I can't restart any time soon to check)?

    BTW, the following (wrong?) syntax does open these files, though:

    $ winmergeu c:JavaRa.log C:AUTOEXEC.BAT

    The correct syntax works:
    $ winmergeu c:\JavaRa.log C:\AUTOEXEC.BAT

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Thanks for the info.

    Don't you need /cygdrive/ in beginning of the path? Eg. /cygdrive/c/JavaRa.log /cygdrive/c/AUTOEXEC.BAT

    Hmm. WinMerge could add this 'cygdrive' prefix to the paths using / as path separator. But I'm not sure if that is good idea generally.

     
  • Kimmo Varis

    Kimmo Varis - 2009-02-28
    • status: open-fixed --> closed-fixed
     
  • Kimmo Varis

    Kimmo Varis - 2009-02-28

    These "full" Cygwin paths work for me. I'm not even sure if /c/work -style paths are supported by Cygwin officially.

    So closing this as fixed.

     

Log in to post a comment.