From 7cb3f2f33a12dd915976d071ed85566036f366a2 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Tue, 6 Aug 2024 08:07:57 +0200 Subject: [PATCH] vi: cleanup code --- bld/vi/c/init.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bld/vi/c/init.c b/bld/vi/c/init.c index dc5a654e05..b199966b79 100644 --- a/bld/vi/c/init.c +++ b/bld/vi/c/init.c @@ -548,24 +548,24 @@ static void doInitializeEditor( int argc, char *argv[] ) for( i = 0; i < startcnt; i++ ) { GetFromEnv( startup[i], tmp ); ReplaceString( &cfgFN, tmp ); - if( cfgFN[0] != '\0' ) { - if( startup_parms[i] != NULL ) { - parm = startup_parms[i]; - } else { - parm = ""; - } + if( cfgFN == NULL || *cfgFN == '\0' ) + continue; + if( startup_parms[i] != NULL ) { + parm = startup_parms[i]; + } else { + parm = ""; + } #if defined( __NT__ ) && !defined( __WIN__ ) - { - if( !EditFlags.Quiet ) { - SetConsoleActiveScreenBuffer( OutputHandle ); - } + { + if( !EditFlags.Quiet ) { + SetConsoleActiveScreenBuffer( OutputHandle ); } + } #endif - sline = 0; - rc = Source( cfgFN, parm, &sline ); - if( rc > ERR_NO_ERR ) { - Error( "%s on line %u of \"%s\"", GetErrorMsg( rc ), sline, cfgFN ); - } + sline = 0; + rc = Source( cfgFN, parm, &sline ); + if( rc > ERR_NO_ERR ) { + Error( "%s on line %u of \"%s\"", GetErrorMsg( rc ), sline, cfgFN ); } } if( argc == 1 ) {