delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/21/10:45:39

Date: Mon, 21 Aug 2000 17:46:40 +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: <9791-Mon21Aug2000174639+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: <39A1181F.C25823B3@softhome.net> (message from Laurynas Biveinis
on Mon, 21 Aug 2000 13:53:03 +0200)
Subject: Re: Patch: symlinks to programs
References: <39A1181F DOT C25823B3 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: Mon, 21 Aug 2000 13:53:03 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
> 
> Here are changes for dosexec.c to DTRT with symlinks.

I have one request: when sending non-trivial diffs for complex
sources, please say "diff -up" or "diff -cp": this causes Diff to
print the function name with each hunk, which makes the diffs much
easier to understand.

> @@ -586,7 +591,7 @@
>       usual DOS command line and the !proxy one (which will be put
>       into the environment).  Sigh...  */
>    save_argv0 = argv[0];
> -  argv[0] = unconst(program, char *); /* since that's where we really found it */
> +  argv[0] = unconst(program, char *);

Please don't remove existing comments unless you have a very good
reason for that.

> RCS file: args.c
> diff -N args.c
> --- /dev/null	Tue May  5 16:32:27 1998
> +++ args.c	Mon Aug 21 07:42:04 2000
> @@ -0,0 +1,9 @@
> +#include <stdio.h>
> +
> +int main(int argc, char *argv[])
> +{
> +   int i;
> +   for (i = 0; i < argc; i++)
> +      printf("argv[%d] = %s\n", i, argv[i]);
> +   return 0;
> +}

You didn't really mean that, did you?

> Index: djgpp/tests/libc/dos/process/makefile
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/tests/libc/dos/process/makefile,v
> retrieving revision 1.1
> diff -u -r1.1 makefile
> --- makefile	1995/11/13 03:14:50	1.1
> +++ makefile	2000/08/21 11:42:04
> @@ -1,5 +1,7 @@
>  TOP=../..
>  
> +SRC += args.c
>  SRC += spawnvp.c
> +SRC += symlinks.c

...and also this.

> +int main(void)
> +{
> +   symlink("args.exe", "linkargs.exe");
> +   system("args.exe 1 2 3");
> +   system("linkargs.exe 4 5 6");
> +   spawnl(P_WAIT, "args.exe", "args.exe", "what", NULL);
> +   spawnl(P_WAIT, "linkargs.exe", "linkargs.exe", "where", "why", NULL);
> +   remove("linkargs.exe");
> +   symlink("C:/command.com", "linkcom.com");
> +   system("linkcom.com");
> +   remove("linkcom.com");
> +   symlink("test.sh", "linksh.sh");
> +   system("test.sh");
> +   system("linksh.sh");
> +   remove("linksh.sh");
> +   return 0;
> +}

One thing that should be tested is when the symlink is not in the
current directory, but along the PATH.  I don't think the above tests
this situation, does it?

- Raw text -


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