[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX
From: |
KO Myung-Hun |
Subject: |
[PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX |
Date: |
Tue, 9 Dec 2014 10:40:48 +0900 |
UNIXROOT is used to specify a drive of a root of FHS. So if a path is
started with '/', then it should be translated to "$UNIXROOT/".
* lib/relocatable.c (relocate): Prepend $UNIXROOT to pathname if it is
started with '/' on EMX.
---
lib/relocatable.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/lib/relocatable.c b/lib/relocatable.c
index 6c6ea1c..1d6fdd5 100644
--- a/lib/relocatable.c
+++ b/lib/relocatable.c
@@ -537,6 +537,27 @@ relocate (const char *pathname)
}
}
}
+
+#ifdef __EMX__
+ if (pathname && ISSLASH (pathname[0]))
+ {
+ const char *unixroot = getenv ("UNIXROOT");
+
+ if (unixroot && HAS_DEVICE (unixroot) && !unixroot[2])
+ {
+ char *result = (char *) xmalloc (2 + strlen (pathname) + 1);
+#ifdef NO_XMALLOC
+ if (result != NULL)
+#endif
+ {
+ strcpy (result, unixroot);
+ strcpy (result + 2, pathname);
+ return result;
+ }
+ }
+ }
+#endif
+
/* Nothing to relocate. */
return pathname;
}
--
1.8.5.2
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, (continued)
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/18
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/19
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, Daiki Ueno, 2014/12/19
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/19
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, Daiki Ueno, 2014/12/24
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/24
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, Daiki Ueno, 2014/12/25
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/25
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, Daiki Ueno, 2014/12/26
- Re: [PATCH 02/14] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/12/26
[PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX,
KO Myung-Hun <=
[PATCH 04/14] binary-io: don't put fd in binary mode if it is a console on EMX, KO Myung-Hun, 2014/12/08
[PATCH 05/14] pipe-filter-aux: undefine HAVE_SELECT on KLIBC, KO Myung-Hun, 2014/12/08
[PATCH 06/14] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 07/14] getdtablesize: do not use getrlimit() on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 08/14] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC, KO Myung-Hun, 2014/12/08
[PATCH 09/14] utimes: detect utimes() correctly on OS/2 kLIBC, KO Myung-Hun, 2014/12/08