Source-Changes-HG archive

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

[src/trunk]: src/libexec/ld.elf_so Better fix of parser bug.



details:   https://anonhg.NetBSD.org/src/rev/77c9fc6b7e02
branches:  trunk
changeset: 537752:77c9fc6b7e02
user:      junyoung <junyoung%NetBSD.org@localhost>
date:      Sat Oct 05 15:43:56 2002 +0000

description:
Better fix of parser bug.

diffstat:

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

diffs (38 lines):

diff -r 655b8e670d27 -r 77c9fc6b7e02 libexec/ld.elf_so/paths.c
--- a/libexec/ld.elf_so/paths.c Sat Oct 05 15:24:43 2002 +0000
+++ b/libexec/ld.elf_so/paths.c Sat Oct 05 15:43:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: paths.c,v 1.21 2002/10/05 15:04:49 junyoung Exp $       */
+/*     $NetBSD: paths.c,v 1.22 2002/10/05 15:43:56 junyoung Exp $       */
 
 /*
  * Copyright 1996 Matt Thomas <matt%3am-software.com@localhost>
@@ -359,19 +359,23 @@
                doing_path = *b == '/';
 
                len = strcspn(b, "\n#");
+               if (len == 0) {
+                       if (*b == '#')
+                               b += strcspn(b, "\n");                  
+                       continue;
+               }
+
                if (doing_path)
-                       path_p = _rtld_append_path(head_p, path_p, b, len);
+                       path_p = _rtld_append_path(head_p, path_p, b, 
+                           strcspn(b, " \t"));
                else {
                        char tmp = b[len];
                        b[len] = '\0';
-                       if (len != 0)
-                               _rtld_process_mapping(lib_p, b, len);
+                       _rtld_process_mapping(lib_p, b, len);
                        b[len] = tmp;
                }
                        
                b += len;
-               if (*b == '#')
-                       b += strcspn(b, "\n");
        }
 
        (void)munmap(buf, sz);



Home | Main Index | Thread Index | Old Index