Message-Id: <3.0.1.32.19971106105708.007dd210@yacker.xiotech.com> Date: Thu, 06 Nov 1997 10:57:08 -0600 To: eliz AT is DOT elta DOT co DOT il From: Randy Maas Subject: Re: 971009 djsplit & djmerge Cc: Vik DOT Heyndrickx AT rug DOT ac DOT be, djgpp-workers AT delorie DOT com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Precedence: bulk >On Thu, 6 Nov 1997, Vik Heyndrickx wrote: > fprintf(stderr,"Usage: %s [inputBase] [outputFile]\n", argv[0]); > >The downside of this is that you (usually) get in argv[0] the whole path name of the program, which might be quite long. maybe, in a not so elegant fashion, this would do a decent job: char *last_sep = strrchr(argv[0], '/'); if (last_sep && last_sep[0]) last_sep++; /* skip past the slash */ else last_sep=argv[0]; /* it wasn't the whole path */ fprintf(stderr,"Usage: %s [inputBase] [outputFile]\n", last_sep); Of course that can be compacted a lot....