void init_paths(const char *prefix)

{

    char pref_buf[PATH_MAX];



    if (prefix[0] == '\0' ||

        !strcmp(prefix, "/"))

        return;



    if (prefix[0] != '/') {

        char *cwd = getcwd(NULL, 0);

        size_t pref_buf_len = sizeof(pref_buf);



        if (!cwd)

            abort();

        pstrcpy(pref_buf, sizeof(pref_buf), cwd);

        pstrcat(pref_buf, pref_buf_len, "/");

        pstrcat(pref_buf, pref_buf_len, prefix);

        free(cwd);

    } else

        pstrcpy(pref_buf, sizeof(pref_buf), prefix + 1);



    base = new_entry("", NULL, pref_buf);

    base = add_dir_maybe(base);

    if (base->num_entries == 0) {

        g_free(base->pathname);

        free(base->name);

        free(base);

        base = NULL;

    } else {

        set_parents(base, base);

    }

}

void init_paths(const char *prefix)

{

    char pref_buf[PATH_MAX];



    if (prefix[0] == '\0' ||

        !strcmp(prefix, "/"))

        return;



    if (prefix[0] != '/') {

        char *cwd = getcwd(NULL, 0);

        size_t pref_buf_len = sizeof(pref_buf);



        if (!cwd)

            abort();

        pstrcpy(pref_buf, sizeof(pref_buf), cwd);

        pstrcat(pref_buf, pref_buf_len, "/");

        pstrcat(pref_buf, pref_buf_len, prefix);

        free(cwd);

    } else

        pstrcpy(pref_buf, sizeof(pref_buf), prefix + 1);



    base = new_entry("", NULL, pref_buf);

    base = add_dir_maybe(base);

    if (base->num_entries == 0) {

        g_free(base->pathname);

        free(base->name);

        free(base);

        base = NULL;

    } else {

        set_parents(base, base);

    }

}

        free(base->name);         free(base);
void FUNC_0(const char *VAR_0)

{

    char VAR_1[PATH_MAX];



    if (VAR_0[0] == '\0' ||

        !strcmp(VAR_0, "/"))

        return;



    if (VAR_0[0] != '/') {

        char *VAR_2 = getcwd(NULL, 0);

        size_t pref_buf_len = sizeof(VAR_1);



        if (!VAR_2)

            abort();

        pstrcpy(VAR_1, sizeof(VAR_1), VAR_2);

        pstrcat(VAR_1, pref_buf_len, "/");

        pstrcat(VAR_1, pref_buf_len, VAR_0);

        free(VAR_2);

    } else

        pstrcpy(VAR_1, sizeof(VAR_1), VAR_0 + 1);



    base = new_entry("", NULL, VAR_1);

    base = add_dir_maybe(base);

    if (base->num_entries == 0) {

        g_free(base->pathname);

        free(base->name);

        free(base);

        base = NULL;

    } else {

        set_parents(base, base);

    }

}

void FUNC_0(const char *VAR_0)
{ char VAR_1[PATH_MAX]; if (VAR_0[0] == '\0' ||
!strcmp(VAR_0, "/"))
return; if (VAR_0[0] != '/') { char *VAR_2 = getcwd(NULL, 0); size_t pref_buf_len = sizeof(VAR_1); if (!VAR_2)
abort(); pstrcpy(VAR_1, sizeof(VAR_1), VAR_2); pstrcat(VAR_1, pref_buf_len, "/"); pstrcat(VAR_1, pref_buf_len, VAR_0); free(VAR_2); } else pstrcpy(VAR_1, sizeof(VAR_1), VAR_0 + 1); base = new_entry("", NULL, VAR_1); base = add_dir_maybe(base); if (base->num_entries == 0) { g_free(base->pathname); free(base->name); free(base); base = NULL; } else { set_parents(base, base); } }