improved indentation

This commit is contained in:
h_vogt 2009-06-11 20:16:20 +00:00
parent 9aad956864
commit 88804b2732
1 changed files with 21 additions and 22 deletions

View File

@ -210,7 +210,8 @@ ft_cpinit(void)
Spice_Lib_Dir has been set to NGSPICEDATADIR in conf.c, Spice_Lib_Dir has been set to NGSPICEDATADIR in conf.c,
Lib_Path has been set to Spice_Lib_Dir adding /scripts in ivars() */ Lib_Path has been set to Spice_Lib_Dir adding /scripts in ivars() */
if (Lib_Path && *Lib_Path) { if (Lib_Path && *Lib_Path) {
(void) sprintf(buf, "sourcepath = ( %s %s )", DIR_CWD, Lib_Path); /* set variable 'sourcepath' */
(void) sprintf(buf, "sourcepath = ( %s %s )", DIR_CWD, Lib_Path);
wl = cp_doglob(cp_lexer(buf)); wl = cp_doglob(cp_lexer(buf));
cp_striplist(wl); cp_striplist(wl);
com_set(wl); com_set(wl);
@ -218,39 +219,37 @@ ft_cpinit(void)
/* Now source the standard startup file. */ /* Now source the standard startup file. */
/* remove leading spaces */ /* jump over leading spaces */
for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) { for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) {
while (isspace(*s)) while (isspace(*s))
s++; s++;
/* copy s into buf until space is seen, r is the actual position */ /* copy s into buf until space is seen, r is the actual position */
for (r = buf; *s && !isspace(*s); r++, s++) for (r = buf; *s && !isspace(*s); r++, s++)
*r = *s; *r = *s;
tfree(copys); /* sjb - it's safe to free this here */ 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);
#ifdef TCL_MODULE #ifdef TCL_MODULE
/* add "tclspinit" to buf after actual position */ /* add "tclspinit" to buf after actual position */
(void) strcat(r, "tclspinit"); (void) strcat(r, "tclspinit");
#else #else
/* 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"))) { if ((fp = fopen(buf, "r"))) {
cp_interactive = FALSE; cp_interactive = FALSE;
inp_spsource(fp, TRUE, buf); inp_spsource(fp, TRUE, buf);
cp_interactive = TRUE; cp_interactive = TRUE;
found = TRUE; found = TRUE;
break; break;
} else if (ft_controldb) } else if (ft_controldb)
fprintf(cp_err, "Note: can't open \"%s\".\n", buf); fprintf(cp_err, "Note: can't open \"%s\".\n", buf);
} }
if (!found) if (!found)
fprintf(cp_err, "Note: can't find init file.\n"); fprintf(cp_err, "Note: can't find init file.\n");
} }
tcap_init( ); tcap_init( );
/* tfree(copys);*/ /*DG Avoid memory leak*/
/* SJB - must not free here as cp_tildexpande() can return NULL */
return; return;
} }