delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/01/19/20:31:05

From: fujieda AT jaist DOT ac DOT jp (Kazuhiro Fujieda)
Subject: Re: relative path script
19 Jan 1999 20:31:05 -0800 :
Message-ID: <uhftmk226.fsf.cygnus.cygwin32.developers@parvati.will.or.jp>
References: <ubtjx80o1 DOT fsf AT parvati DOT will DOT or DOT jp>
Mime-Version: 1.0 (generated by SEMI MIME-Edit 0.100 - "Shijima")
To: cygwin32-developers AT cygnus DOT com

>>> On 18 Jan 1999 17:06:54 +0900
>>> Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp> said:

> For example,
> $ echo '#!/bin/sh' > foo
> $ mkdir bar
> $ cd bar
> $ ../foo
> ../../foo: Can't open ../../foo
(snip)

The following patch fixes this problem.  Either script found
through a relative search path or directly specified by a
relative path works fine.

--- spawn.cc-	Mon Jan 18 17:54:48 1999
+++ spawn.cc	Tue Jan 19 13:32:07 1999
@@ -404,7 +404,7 @@ debug_printf ("argv[%d] = '%s'", argc, a
        * but not /usr/local/bin/wish -f tkman!
        * We don't modify anything, if script has qulified path.
        */
-      if (strpbrk (saved_prog_arg, "\\/") && !isabspath (copy))
+      if (strpbrk (saved_prog_arg, "\\/") && !strpbrk (copy, "\\/"))
 	{
 	  debug_printf ("getting path of %s, copy %s", saved_prog_arg, buf);
 	  cygwin_split_path (saved_prog_arg, strchr(f, '\0'), buf);

____
  | AIST      Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

- Raw text -


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