Looking at the code (src/imain.c in lenny, psi/imain.c in unstable) the
code looks like


|    int first_is_here =
|        (r_size(&minst->lib_path.list) != 0 &&
|         paths[0].value.bytes == (const byte *)gp_current_directory_name ? 1 : 
0);
|    int code = 0;
|    int count = minst->lib_path.count;
|    int i, have_rom_device = 0;
|
|    if (minst->search_here_first) {
|        if (!(first_is_here ||
|              (r_size(&minst->lib_path.list) != 0 &&
|               !bytes_compare((const byte *)gp_current_directory_name,
|                              strlen(gp_current_directory_name),
|                              paths[0].value.bytes,
|                              r_size(&paths[0]))))
|            ) {
|            memmove(paths + 1, paths, count * sizeof(*paths));
|            make_const_string(paths, avm_foreign | a_readonly,
|                              strlen(gp_current_directory_name),
|                              (const byte *)gp_current_directory_name);
|        }
|    } else {
|        if (first_is_here)
|            memmove(paths, paths + 1, count * sizeof(*paths));
|    }
|    r_set_size(&minst->lib_path.list,
|               count + (minst->search_here_first ? 1 : 0));

With -P- that code seems to be called twice. The first time with
search_here_first still true, the second time time false.

Unless I' mistaken, the r_set_size call is buggy. That looks to do
the wrong thing both when the current dir is already there (dunno why
it does not segfault though, perhaps coincidence) and it does not reduce
the count when the "." should habe been removed again.

        Bernhard R. Link



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to