15 chown(
char *path,
int owner,
int group)
22 link(
char *from,
char *to)
28 #if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD) \
29 || defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
32 #if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD)
35 getcwd(
char *path,
size_t len)
37 return _getcwd2(path, (
int)len);
41 #if defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
44 chdir(__const__
char *path)
60 char *shell, *sw, *cmd2;
63 if ((shell =
getenv(
"RUBYSHELL")) !=
NULL && *shell !=
'\0') {
66 *s = isupper(*s) ? tolower(*s) : *s;
72 }
else if ((shell =
getenv(
"SHELL")) !=
NULL && *shell !=
'\0') {
75 *s = isupper(*s) ? tolower(*s) : *s;
81 }
else if ((shell =
getenv(
"COMSPEC")) !=
NULL && *shell !=
'\0') {
84 *s = isupper(*s) ? tolower(*s) : *s;
96 for (s = cmd; *s; s++) {
97 if (*sw ==
'-' && *s !=
' ' &&
98 !isalpha(*s) && index(
"$&*(){}[]'\";\\|?<>~`\n",*s)) {
99 if (*s ==
'\n' && !s[1]) {
104 }
else if (*sw ==
'/' && *s !=
' ' &&
105 !isalpha(*s) && index(
"^()<>|&\n",*s)) {
106 if (*s ==
'\n' && !s[1]) {
111 status = spawnlp(P_WAIT,shell,shell,sw,cmd,(
char*)
NULL);
119 for (s = cmd2; *s;) {
120 while (*s && isspace(*s)) s++;
123 while (*s && !isspace(*s)) s++;
129 if ((status = spawnvp(P_WAIT, argv[0], argv)) == -1) {