delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/04/23/11:09:46

To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>,
DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: (Fileutils) More test suite & Fetish.pm problems
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010423132702 DOT 25673D-100000 AT is>
In-Reply-To: <Pine.SUN.3.91.1010423132702.25673D-100000@is> (Eli Zaretskii's message of "Mon, 23 Apr 2001 13:27:34 +0300 (IDT)")
From: Jim Meyering <jim AT meyering DOT net>
Date: 23 Apr 2001 12:55:54 +0200
Message-ID: <uryd7a3996t.fsf@ixi.eng.ascend.com>
Lines: 39
User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103
MIME-Version: 1.0
Sender: Jim Meyering <meyering AT ascend DOT com>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
| On 22 Apr 2001, Jim Meyering wrote:
|
| > If I understand, those problems are all because a program invoked
| > like `mv a b' will get argv[0] set to ../../src/mv.  Is that true?
|
| That's one possibility, yes.  It's also possible to get the full
| absolute file name in argv[0], as in "c:/foo/bar/bin/mv.exe".
|
| > If so, I wonder if that's a problem with the way djgpp's bash calls exec.
|
| It's not a Bash problem, it's a ``feature'' of the DOS system call
| which loads and executes a program: you always get leading directories
| in argv[0].  Bash cannot work around this.
|
| I don't think Posix mandates that argv[0] should not include leading
| directories.  I think some Unix shells do produce argv[0] similar to
| ../../src/mv.  So I think it would be good for Fetish test suites not
| to depend on the exact form of argv[0] too much.

Changing the test suite so it accommodates this behavior would be a pain.
In the latest test release of the fileutils, there are many more than the
three that were affected in 4.0.
I haven't seen the losing behavior on any Unix system.

It'd sure be nice if Windows would join the modern world...
I'm not sure if the following (from the d6 draft) is a real requirement,
but it certainly seems to discourage what DOS/Windows does.

  The requirement on a Strictly Conforming POSIX Application also states
  that the value passed as the first argument be a filename associated
  with the process being started. Although some existing applications pass
  a pathname rather than a filename in some circumstances, a filename
  is more generally useful, since the common usage of argv[0] is in
  printing diagnostics. In some cases the filename passed is not the
  actual filename of the file; for example, many implementations of the
  login utility use a convention of prefixing a hyphen ('-') to the actual
  filename, which indicates to the command interpreter being invoked that
  it is a ``login shell''.  Some implementations can exec shell scripts.

- Raw text -


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