src/cforth/io.c
char *make_path(char *name)
{
    if (isabsolute(name)) {
        return strdup(name);
    }

    // input_dir() includes the final '/' if len is nonzero
    size_t len;
    char *current = input_dir(&len);
    if (len == 0) {
        printf("Warning - empty base path\n");
        return strdup(current);
    }

    char *new = malloc(len + strlen(name) + 1);
    strncpy(new, current, len);
    strcpy(new+len, name);
    return new;
}
// Given a filename name, return its absolute path.  If name is already
// absolute, there is no more to be done.  Otherwise, append name to
// the path of the current input.
Given a filename name, return its absolute path.  If name is already
absolute, there is no more to be done.  Otherwise, append name to
the path of the current input.
Given a filename name return its absolute path . If name is already absolute there is no more to be done . Otherwise append name to the path of the current input .
char *make_path(char *name)
{
    if (isabsolute(name)) {
        return strdup(name);
    }
    size_t len;
    char *current = input_dir(&len);
    if (len == 0) {
        printf("Warning - empty base path\n");
        return strdup(current);
    }
    char *new = malloc(len + strlen(name) + 1);
    strncpy(new, current, len);
    strcpy(new+len, name);
    return new;
}
char * make_path ( char * name ) { if ( isabsolute ( name ) ) { return strdup ( name ) ; } size_t len ; char * current = input_dir ( & len ) ; if ( len == 0 ) { printf ( " \n " ) ; return strdup ( current ) ; } char * new = malloc ( len + strlen ( name ) + 1 ) ; strncpy ( new , current , len ) ; strcpy ( new + len , name ) ; return new ; }
Given a filename name, return its absolute path.
Given a filename name return its absolute path .
// input_dir() includes the final '/' if len is nonzero