Browse Source

enable paths with spaces for finding 'spinit'

pre-master-46
Holger Vogt 5 years ago
parent
commit
3e98cecd56
  1. 11
      src/frontend/cpitf.c

11
src/frontend/cpitf.c

@ -271,9 +271,15 @@ ft_cpinit(void)
/* jump over leading spaces */ /* jump over leading spaces */
for (copys = s = cp_tildexpand(Lib_Path); copys && *copys; ) { for (copys = s = cp_tildexpand(Lib_Path); copys && *copys; ) {
s = skip_ws(s); s = skip_ws(s);
/* copy s into buf until space is seen, r is the actual position */
for (r = buf; *s && !isspace_c(*s); r++, s++)
/* copy s into buf until end of s, r is the actual position in buf */
int ii;
for (r = buf, ii = 0; *s; r++, s++, ii++) {
*r = *s; *r = *s;
if (ii > 500) {
fprintf(stderr, "Warning: spinit path is too long.\n");
break;
}
}
tfree(copys); tfree(copys);
/* add a path separator to buf at actual position */ /* add a path separator to buf at actual position */
(void) strcpy(r, DIR_PATHSEP); (void) strcpy(r, DIR_PATHSEP);
@ -284,6 +290,7 @@ ft_cpinit(void)
/* add "spinit" to buf after actual position */ /* add "spinit" to buf after actual position */
(void) strcat(r, "spinit"); (void) strcat(r, "spinit");
#endif #endif
if ((fp = fopen(buf, "r")) != NULL) { if ((fp = fopen(buf, "r")) != NULL) {
cp_interactive = FALSE; cp_interactive = FALSE;

Loading…
Cancel
Save