summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorpk <pk@NetBSD.org>1993-11-08 13:20:39 +0000
committerpk <pk@NetBSD.org>1993-11-08 13:20:39 +0000
commit168c91b81309247cfb81f5d9e3afcc161cbc06d0 (patch)
treeb5a6f1906b526d5a32201df522e2dff7daaacfd2 /libexec
parenteb5665b095117c6fc8be7be3818adb4ea697b745 (diff)
Use strsep() in stead of strtok() and restore colons in eg. env. vars.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.aout_so/Makefile4
-rw-r--r--libexec/ld.aout_so/rtld.c7
-rw-r--r--libexec/ld.aout_so/shlib.c7
3 files changed, 10 insertions, 8 deletions
diff --git a/libexec/ld.aout_so/Makefile b/libexec/ld.aout_so/Makefile
index ea0260898ce..a7975f668a4 100644
--- a/libexec/ld.aout_so/Makefile
+++ b/libexec/ld.aout_so/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 1993/10/27 00:55:24 pk Exp $
+# $Id: Makefile,v 1.3 1993/11/08 13:20:39 pk Exp $
PROG= ld.so
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
@@ -16,7 +16,7 @@ BINDIR= /usr/libexec
.SUFFIXES: .S
$(PROG):
- $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
+ $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS) $(LDADD)
.S.o:
$(CPP) $(.IMPSRC) | $(AS) -k -o $(.TARGET) -
diff --git a/libexec/ld.aout_so/rtld.c b/libexec/ld.aout_so/rtld.c
index 433820af1be..e833787d6d7 100644
--- a/libexec/ld.aout_so/rtld.c
+++ b/libexec/ld.aout_so/rtld.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.7 1993/11/03 21:35:54 pk Exp $
+ * $Id: rtld.c,v 1.8 1993/11/08 13:20:40 pk Exp $
*/
#include <sys/param.h>
@@ -888,10 +888,11 @@ int *usehints;
if (ld_path != NULL) {
/* Prefer paths from LD_LIBRARY_PATH */
- while ((cp = strtok(ld_path, ":")) != NULL) {
+ while ((cp = strsep(&ld_path, ":")) != NULL) {
- ld_path = NULL;
hint = findhint(name, major, minor, cp);
+ if (ld_path)
+ *(ld_path-1) = ':';
if (hint)
return hint;
}
diff --git a/libexec/ld.aout_so/shlib.c b/libexec/ld.aout_so/shlib.c
index 4be8354840c..55cd8c387c5 100644
--- a/libexec/ld.aout_so/shlib.c
+++ b/libexec/ld.aout_so/shlib.c
@@ -1,5 +1,5 @@
/*
- * $Id: shlib.c,v 1.3 1993/10/23 00:34:26 pk Exp $
+ * $Id: shlib.c,v 1.4 1993/11/08 13:21:23 pk Exp $
*/
#include <sys/param.h>
@@ -48,9 +48,10 @@ char *paths;
if (paths != NULL)
/* Add search directories from `paths' */
- while ((cp = strtok(paths, ":")) != NULL) {
- paths = NULL;
+ while ((cp = strsep(&paths, ":")) != NULL) {
add_search_dir(cp);
+ if (paths)
+ *(paths-1) = ':';
}
/* Append standard search directories */