tools/extract-pkg.c
static void sanitize_path(char *path)
{
    int warned = 0;
    for (char *s = strstr(path, "../"); s; s = strstr(s, "../")) {
        if (s > path && s[-1] != '/') {
            /* Just a ".." at the end of something else, which is harmless. */
            s += 3;
            continue;
        }
        if (!warned) {
            fprintf(stderr, "%s: warning: removing ../ components\n", path);
            warned = 1;
        }
        memmove(s, s+3, strlen(s+3)+1);
    }
}
/**
 * sanitize_path:  Sanitize the given pathname by removing all ../
 * components.  A warning is printed to stderr if any components are removed.
 *
 * [Parameters]
 *     path: Pathname to sanitize (modified in place).
 */
Sanitize the given pathname by removing all
components.  A warning is printed to stderr if any components are removed.

[Parameters]
path: Pathname to sanitize (modified in place).
Sanitize the given pathname by removing all components . A warning is printed to stderr if any components are removed . [ Parameters ] path : Pathname to sanitize ( modified in place ) .
static void sanitize_path(char *path)
{
    int warned = 0;
    for (char *s = strstr(path, "../"); s; s = strstr(s, "../")) {
        if (s > path && s[-1] != '/') {
            s += 3;
            continue;
        }
        if (!warned) {
            fprintf(stderr, "%s: warning: removing ../ components\n", path);
            warned = 1;
        }
        memmove(s, s+3, strlen(s+3)+1);
    }
}
static void sanitize_path ( char * path ) { int warned = 0 ; for ( char * s = strstr ( path , " " ) ; s ; s = strstr ( s , " " ) ) { if ( s > path && s [ -1 ] != ' ' ) { s += 3 ; continue ; } if ( ! warned ) { fprintf ( stderr , " \n " , path ) ; warned = 1 ; } memmove ( s , s + 3 , strlen ( s + 3 ) + 1 ) ; } }
sanitize_path:  Sanitize the given pathname by removing all ..
 components.
sanitize_path : Sanitize the given pathname by removing all .. components .
/* Just a ".." at the end of something else, which is harmless. */