[RFT/RFA/MinGW] remove some extraneous changes in readline/terminal.c

Joel Brobecker brobecker@adacore.com
Wed Oct 17 17:07:00 GMT 2012


Hello,

While looking at Pierre's patch, I noticed that _rl_get_screen_size
was doing the same thing twice, namely:

      /* For MinGW, we get the console size from the Windows API.  */
    #if defined (__MINGW32__)
      HANDLE hConOut = GetStdHandle (STD_OUTPUT_HANDLE);
      [... etc ...]
    #endif

... immediately followed by:

    #if defined (__EMX__)
      _emx_get_screensize (&wc, &wr);
    #elif defined (__MINGW32__)
      _win_get_screensize (&wc, &wr);
    #endif

But if you look at the body of _win_get_screensize, it is actually
identical to what the first block does.

I reviewed the readline 6.2 sources, and the first hunk isn't there,
only the call to _win_get_screensize. So, I'm thinking this might be
a merge oversight, where a different version of a patch got checked
in the standard readline sources, whereas we checked in a slightly
different version in our copy.

I tested the change by rebuilding GDB, and by running GDB through
ssh, but I don't have a quick access to a DOS window to test it
in that environment. I'd appreciate a quick test there as well,
especially after having installed Pierre's patch
(http://www.sourceware.org/ml/gdb-patches/2012-10/msg00265.html).

readline/ChangeLog.gdb:

        * terminal.c: Remove duplicate includes of windows.h and
        wincon.h.
        (_rl_get_screen_size): Remove redundant code for MinGW getting
        the console size from the Windows API.

Given the small amount of testing, I won't commit unless someone
reviews this patch and agrees that it is correct.

Thank you,
-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readline-mingw.diff
Type: text/x-diff
Size: 1065 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20121017/95a172bc/attachment.bin>


More information about the Gdb-patches mailing list