]> code.ossystems Code Review - openembedded-core.git/commit
pseudo: Make realpath() remove trailing slashes
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 24 Dec 2019 07:21:09 +0000 (15:21 +0800)
committerArmin Kuster <akuster808@gmail.com>
Thu, 9 Jan 2020 04:30:10 +0000 (20:30 -0800)
commitc251e753486dae9b460df315a6d19d6c81098ecb
treee1437c06b988ac136288798be8945650dd3607dc
parent9a2748db44c4382bbba81a5a9b96c998f0fab983
pseudo: Make realpath() remove trailing slashes

Linux system's realpath() remove trailing slashes, but pseudo's doesn't, need
make them identical.

E.g., the following code (rel.c) prints '/tmp' with system's realpath, but
pseudo's realpath prints '/tmp/':

    #include <stdio.h>
    #include <limits.h>
    #include <stdlib.h>

    int main() {
        char out[PATH_MAX];
        printf("%s\n", realpath("/tmp/", out));
        return 0;
    }

$ bitbake base-passwd -cdevshell # For pseudo env
$ gcc rel.c
$ ./a.out
/tmp/ (but should be /tmp)

This patch fixes the problem.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 319bbf66e03377adf2db7efa93ef578e3460eb38)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch [new file with mode: 0644]
meta/recipes-devtools/pseudo/pseudo_git.bb