Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 459 of file preproc.c.
{ char *tok; char *cpy = pp_xstrdup(path); if(!cpy) return 1; tok = strtok(cpy, INCLUDESEPARATOR); while(tok) { if(*tok) { char *dir; char *cptr; char **new_path; dir = pp_xstrdup(tok); if(!dir) { free(cpy); return 1; } for(cptr = dir; *cptr; cptr++) { /* Convert to forward slash */ if(*cptr == '\\') *cptr = '/'; } /* Kill eventual trailing '/' */ if(*(cptr = dir + strlen(dir)-1) == '/') *cptr = '\0'; /* Add to list */ new_path = pp_xrealloc(includepath, (nincludepath+1) * sizeof(*includepath)); if(!new_path) { free(dir); free(cpy); return 1; } includepath = new_path; includepath[nincludepath] = dir; nincludepath++; } tok = strtok(NULL, INCLUDESEPARATOR); } free(cpy); return 0; }