delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/23/06:47:26

Date: Wed, 23 Aug 2000 13:48:25 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: lauras AT softhome DOT net
Message-Id: <3405-Wed23Aug2000134825+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
CC: djgpp-workers AT delorie DOT com
In-reply-to: <39A3A41B.6EBAFD04@softhome.net> (message from Laurynas Biveinis
on Wed, 23 Aug 2000 12:14:51 +0200)
Subject: Re: Patch for fileutils to support symlinks
References: <39A3A41B DOT 6EBAFD04 AT softhome DOT net>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Wed, 23 Aug 2000 12:14:51 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
> 
> diff -urp filutil3.16/src/Makefile filutil3.16.my/src/Makefile
> --- filutil3.16/src/Makefile	Fri May 26 20:40:58 2000
> +++ filutil3.16.my/src/Makefile	Wed Aug 23 12:02:34 2000
> @@ -388,13 +388,11 @@ $(dir_OBJECTS): ../config.h
>  dir: $(dir_OBJECTS) $(dir_DEPENDENCIES) ln
>  	$(LINK) $(dir_LDFLAGS) $(dir_OBJECTS) $(dir_LDADD) $(LIBS)
>  	./ln -s $@ d
> -	stubedit d.exe argv0=dir

This isn't right, but I don't blame you: the reasons for this are
subtle, and I didn't document them anywhere but in the code itself.

Here's the scoop: each Fileutils program *must* get its exact name in
argv[0], and that name *must* be _exactly_ what it was told to expect.
And, that argv[0] must be _without_ the .exe extension.  Otherwise,
some aspects of the programs will mysteriously break.

For the detailed explanation why is this so, see the large comment in
the beginning of the file src/djstart.c, and the code of the
init_stat_bits function defined there.  You will see that each program
sets up the bits for the `stat' function given its name in argv[0].

To make all this work as intended, the two "ln -s/stubedit" lines in
the Makefile need to be changed to run "stubify -g/stubedit" instead,
so that people could invoke gmkdir etc. from the DOS prompt.  After
all, that's why I added those ``symlinks'': to give users a way to
invoke the GNU programs instead of COMMAND.COM's internal commands.

The rest of the patches seem okay to me, but please somebody be sure
to run the test suite after applying them.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019