Prepend /@unixroot to rooted paths on OS/2
$UNIXROOT is a root directory of FHS on OS/2. /@unixroot is replaced by $UNIXROOT at runtime.
This commit is contained in:
2
check.pl
2
check.pl
@ -275,7 +275,7 @@ $all_tests = @ARGV == 0;
|
|||||||
# Set up a very minimal environment
|
# Set up a very minimal environment
|
||||||
%new_env = ();
|
%new_env = ();
|
||||||
foreach $env (('HOME', 'LD_LIBRARY_PATH', 'LOCPATH', 'LOGNAME',
|
foreach $env (('HOME', 'LD_LIBRARY_PATH', 'LOCPATH', 'LOGNAME',
|
||||||
'PATH', 'SHELL', 'UNIXMODE', 'USER')) {
|
'PATH', 'SHELL', 'UNIXMODE', 'USER', 'UNIXROOT')) {
|
||||||
$new_env{$env} = $ENV{$env} if defined $ENV{$env};
|
$new_env{$env} = $ENV{$env} if defined $ENV{$env};
|
||||||
}
|
}
|
||||||
$new_env{'CYGWIN'} = 'nodosfilewarning';
|
$new_env{'CYGWIN'} = 'nodosfilewarning';
|
||||||
|
2
exec.c
2
exec.c
@ -26,7 +26,7 @@
|
|||||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.152 2015/04/29 18:32:43 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.152 2015/04/29 18:32:43 tg Exp $");
|
||||||
|
|
||||||
#ifndef MKSH_DEFAULT_EXECSHELL
|
#ifndef MKSH_DEFAULT_EXECSHELL
|
||||||
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
|
#define MKSH_DEFAULT_EXECSHELL UNIXROOT "/bin/sh"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int comexec(struct op *, struct tbl * volatile, const char **,
|
static int comexec(struct op *, struct tbl * volatile, const char **,
|
||||||
|
6
main.c
6
main.c
@ -43,7 +43,7 @@ extern char **environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MKSH_DEFAULT_TMPDIR
|
#ifndef MKSH_DEFAULT_TMPDIR
|
||||||
#define MKSH_DEFAULT_TMPDIR "/tmp"
|
#define MKSH_DEFAULT_TMPDIR UNIXROOT "/tmp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint8_t isuc(const char *);
|
static uint8_t isuc(const char *);
|
||||||
@ -323,7 +323,9 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
|
|||||||
* "keeping a regular /usr"; this is supposed
|
* "keeping a regular /usr"; this is supposed
|
||||||
* to be a sane 'basic' default PATH
|
* to be a sane 'basic' default PATH
|
||||||
*/
|
*/
|
||||||
def_path = "/bin:/usr/bin:/sbin:/usr/sbin";
|
def_path = UNIXROOT "/bin" PATH_SEP_STR
|
||||||
|
UNIXROOT "/usr/bin" PATH_SEP_STR
|
||||||
|
UNIXROOT "/sbin" PATH_SEP_STR UNIXROOT "/usr/sbin";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
4
sh.h
4
sh.h
@ -303,6 +303,7 @@ struct rusage {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __OS2__
|
#ifdef __OS2__
|
||||||
|
#define UNIXROOT "/@unixroot"
|
||||||
#define PATH_SEP ';'
|
#define PATH_SEP ';'
|
||||||
#define PATH_SEP_STR ";"
|
#define PATH_SEP_STR ";"
|
||||||
#define IS_DIR_SEP(c) ({ \
|
#define IS_DIR_SEP(c) ({ \
|
||||||
@ -328,6 +329,7 @@ struct rusage {
|
|||||||
(ksh_isalphx(_p_[0]) && _p_[1] == ':')); \
|
(ksh_isalphx(_p_[0]) && _p_[1] == ':')); \
|
||||||
})
|
})
|
||||||
#else
|
#else
|
||||||
|
#define UNIXROOT ""
|
||||||
#define PATH_SEP ':'
|
#define PATH_SEP ':'
|
||||||
#define PATH_SEP_STR ":"
|
#define PATH_SEP_STR ":"
|
||||||
#define IS_DIR_SEP(c) ((c) == '/')
|
#define IS_DIR_SEP(c) ((c) == '/')
|
||||||
@ -1083,7 +1085,7 @@ EXTERN mksh_ari_t x_lins E_INIT(24); /* tty lines */
|
|||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
#define MKSH_DEFAULT_PROFILEDIR "/system/etc"
|
#define MKSH_DEFAULT_PROFILEDIR "/system/etc"
|
||||||
#else
|
#else
|
||||||
#define MKSH_DEFAULT_PROFILEDIR "/etc"
|
#define MKSH_DEFAULT_PROFILEDIR UNIXROOT "/etc"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user