]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
pseudo: Make realpath() remove trailing slashes rbt/pseudo
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 25 Nov 2019 11:09:53 +0000 (19:09 +0800)
committerRobert Yang <liezhi.yang@windriver.com>
Tue, 24 Dec 2019 07:15:38 +0000 (15:15 +0800)
commitb763cef4b8957d8140800d46391150599ef56c55
tree42ce2571cfbf1568451f29b8b27377bd63fc5967
parentd6c62cc0305ab082e990041da104fedb5798e0e4
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>
meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch [new file with mode: 0644]
meta/recipes-devtools/pseudo/pseudo_git.bb