[gnu.emacs] Where are command arguments handled?

zuhn@UMN-CS.CS.UMN.EDU ("david d [zoo] zuhn") (08/24/89)

I'm modifying GNU Emacs 18.54 so that it corresponds to the emacs.1 man page,
in regards to the X resources.  Most everything works, but I have added a
feature so that any bitmap file may be specfied and used as the X icon bitmap.

Using an X resource works perfectly:  emacs*iconBitmapFile: <filename> and
the bitmap is used correctly.  So I went a step further, and added a command 
line option -bitmap <filename>, which almost works.  The icon is set using
the contents of the file, but emacs also visits that file on startup.

I've tried to follow what exactly is going on, but I don't know the emacs
code inside-and-out (yet...).

The code segment I use (in x11term.c) is this:

static char* XXicon_filename;
        .
	.

	if ((xxargc > 1) && !strcmp (*xxargv, "-bitmap"))
		  {
		    xxargc--;
		    xxargv++;
		    XXicon_filename = (char *) xmalloc (strlen(*xxargv)+1);
		    strcpy (XXicon_filename, *xxargv);
		    xxargc--; 
		    xxargv++; 
		  }
	.
	.

which I copied almost character-for-character from the segment just above
it, for dealing with the icon name.

Any suggestions for what might be the problem here?  I have modified nothing
outside of x11term.c, and the only other mods in x11term.c are a few changes
in X resource names, and the addition of the code to load the icon on the 
fly.  And yes, I intend to post the changes that I have made, as soon as I
get this one problem fixed.

Thanks.

Dave Zuhn
zuhn@umn-cs.cs.umn.edu or zuhn@ux.acss.umn.edu