Loading ...
Sorry, an error occurred while loading the content.

Re: Patch to fix argv[] problem with gui_x11.c

Expand Messages
  • Michael Jarvis
    ... Okay I tested this patch with Vim 6.2.291 under AIX 5.2 and Motif and it works just fine. Best regards, Michael -- Michael Jarvis michael@jarvis.com
    Message 1 of 4 , Feb 26, 2004
    • 0 Attachment
      On Wed, Feb 25, 2004 at 10:05:32PM +0100, Bram Moolenaar wrote:
      >
      > Michael Jarvis wrote:
      >
      > > I've noticed a problem with the Motif version of gvim. I have an alias
      > > set up that basically executes "gvim -font fixed -o" along with any
      > > filenames I give it.
      > >
      > > So, as an example, I am actually launching:
      > >
      > > gvim -font fixed -o gui_x11.c gui.h
      > >
      > > But when I do a "ps -ef" on an AIX 5.2 box at work, it shows the
      > > arguments as:
      > >
      > > gvim -o gui_x11.c gui.h gui.h gui.h
      > >
      > > (Note that gui.h is repeated three times!)
      > >
      > > Upon doing a little research, I found where we're moving some arguments
      > > out of the command line, but we're not setting the vacated argv[]
      > > elements to NULL.
      >
      > An old rule is that a program or function should not change its
      > arguments. But fixing that is complicated...
      >
      > > The attached patch (should) fix the problem.
      >
      > A slightly simpler solution is like how it's done for GTK:
      >
      > *** ../vim-6.2.291/src/gui_x11.c Mon Dec 29 21:21:52 2003
      > --- src/gui_x11.c Wed Feb 25 21:55:24 2004
      > ***************
      > *** 1217,1222 ****
      > --- 1217,1223 ----
      > * sizeof(char *));
      > }
      > }
      > + argv[*argc] = NULL;
      > }
      > else
      > #ifdef FEAT_SUN_WORKSHOP
      >
      > This should also work when removing the last argument. Do you see a
      > problem with that?

      Okay I tested this patch with Vim 6.2.291 under AIX 5.2 and Motif and it
      works just fine.

      Best regards,
      Michael


      --
      Michael Jarvis
      michael@...
      http://www.jarvis.com/home.php
      "Freiheit stirbt in kleinen Stücken."
    Your message has been successfully submitted and would be delivered to recipients shortly.