delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/01/18/00:32:14

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

Shell scripts executed by relative path can't work because of
the following modification on Jan 11.

@@ -377,5 +373,5 @@ spawn_guts (HANDLE hToken, const char * 
        * We don't modify anything, if script has qulified path.
        */
-      if (isabspath (saved_prog_arg) && !isabspath (copy))
+      if (strpbrk (saved_prog_arg, "\\/") && !isabspath (copy))
        {
          debug_printf ("getting path of %s, copy %s", saved_prog_arg, buf);

For example,
$ echo '#!/bin/sh' > foo
$ mkdir bar
$ chdir bar
$ ../foo
.../../foo: Can't open ../../foo
____
  | 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