]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 Dec 2019 08:45:02 +0000 (08:45 +0000)
commit319bbf66e03377adf2db7efa93ef578e3460eb38
tree51f29b58393f44fe36155be32119cb43d40c74c5
parent197007bac2ad8cba59fa2c68c51bd95e9b66de92
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>
meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch [new file with mode: 0644]
meta/recipes-devtools/pseudo/pseudo_git.bb