Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/libexec/ld.elf_so Pullup 1.14 [simonb]:



details:   https://anonhg.NetBSD.org/src/rev/006fbdd19933
branches:  netbsd-1-5
changeset: 490198:006fbdd19933
user:      tv <tv%NetBSD.org@localhost>
date:      Mon Nov 13 19:10:30 2000 +0000

description:
Pullup 1.14 [simonb]:
Fix linked-list botch with sysctl-based library selection that meant
only the last line was used.  Allow more than one white space character
between fields.

diffstat:

 libexec/ld.elf_so/paths.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 63aa35c505a8 -r 006fbdd19933 libexec/ld.elf_so/paths.c
--- a/libexec/ld.elf_so/paths.c Mon Nov 13 18:47:43 2000 +0000
+++ b/libexec/ld.elf_so/paths.c Mon Nov 13 19:10:30 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: paths.c,v 1.11 2000/05/09 21:55:53 bjh21 Exp $  */
+/*     $NetBSD: paths.c,v 1.11.4.1 2000/11/13 19:10:30 tv Exp $         */
 
 /*
  * Copyright 1996 Matt Thomas <matt%3am-software.com@localhost>
@@ -217,7 +217,10 @@
        memset(hwptr, 0, sizeof(*hwptr));
        hwptr->name = xstrdup(ptr);
 
-       if ((ptr = strsep(&bp, WS)) == NULL) {
+       while ((ptr = strsep(&bp, WS)) != NULL)
+               if (*ptr != '\0')
+                       break;
+       if (ptr == NULL) {
                xwarnx("missing sysctl variable name");
                goto cleanup;
        }
@@ -259,6 +262,11 @@
                            hwptr->ctltype[i]));
 
        for (i = 0; (ptr = strsep(&bp, WS)) != NULL; i++) {
+               if (*ptr == '\0') {
+                       /* back up index and continue */
+                       i--;
+                       continue;
+               }
                if (i == RTLD_MAX_ENTRY) {
 no_more:
                        xwarnx("maximum library entries exceeded `%s'",
@@ -312,10 +320,7 @@
                goto cleanup;
        }
 
-
-       hwptr->next = NULL;
-       if (*lib_p != NULL)
-               (*lib_p)->next = hwptr;
+       hwptr->next = *lib_p;
        *lib_p = hwptr;
 
        return;



Home | Main Index | Thread Index | Old Index