diff --git a/bind.c b/bind.c index 3fac657..32781c8 100644 --- a/bind.c +++ b/bind.c @@ -459,24 +459,17 @@ unsigned int getckey(int mflag) /* * execute the startup file * - * char *sfname; name of startup file (null if default) + * char *fname; name of startup file (null if default) */ -int startup(char *sfname) -{ - char *fname; /* resulting file name to execute */ +int startup( const char *fname) { + if( !fname || *fname == 0) /* use default if empty parameter */ + fname = rcfname ; - /* look up the startup file */ - if (*sfname != 0) - fname = flook(sfname, TRUE); - else - fname = flook( rcfname, TRUE); + fname = flook( fname, TRUE) ; /* look up the startup file */ + if( fname == NULL) /* if it isn't around, don't sweat it */ + return TRUE ; - /* if it isn't around, don't sweat it */ - if (fname == NULL) - return TRUE; - - /* otherwise, execute the sucker */ - return dofile(fname); + return dofile( fname) ; /* otherwise, execute the sucker */ } /* diff --git a/bind.h b/bind.h index 3e4c569..09d7af9 100644 --- a/bind.h +++ b/bind.h @@ -19,7 +19,7 @@ int unbindchar( int c) ; int desbind( int f, int n) ; int buildlist( int type, char *mstring) ; unsigned int getckey( int mflag) ; -int startup( char *sfname) ; +int startup( const char *fname) ; void cmdstr( int c, char *seq) ; fn_t getbind( int c) ; fn_t fncmatch( char *) ; diff --git a/exec.c b/exec.c index e2be224..b0744b9 100644 --- a/exec.c +++ b/exec.c @@ -924,8 +924,7 @@ int execfile(int f, int n) * * char *fname; file name to execute */ -int dofile(char *fname) -{ +int dofile( const char *fname) { struct buffer *bp; /* buffer to place file to exeute */ struct buffer *cb; /* temp to hold current buf while we read */ int status; /* results of various calls */ diff --git a/exec.h b/exec.h index d7cba76..a64c786 100644 --- a/exec.h +++ b/exec.h @@ -25,7 +25,7 @@ int nextarg( const char *prompt, char *buffer, int size, int terminator) ; int storemac( int f, int n) ; int execbuf( int f, int n) ; int execfile( int f, int n) ; -int dofile( char *fname) ; +int dofile( const char *fname) ; int cbuf1( int f, int n) ; int cbuf2( int f, int n) ;