`last` was used but not initialized.
Also fixes a segmentation fault if PATH is not in the environment.
+ path = getenv( "PATH" );
+
/* do some path divining */
strcpy( temp, argv0 );
if ( strrchr( temp, '/' ) ) {
argv0 = strrchr( argv0, '/' ) + 1;
}
/* do some path divining */
strcpy( temp, argv0 );
if ( strrchr( temp, '/' ) ) {
argv0 = strrchr( argv0, '/' ) + 1;
}
- else
- {
- /* get path environment variable */
- path = getenv( "PATH" );
-
- /* minor setup */
- last[ 0 ] = path[ 0 ];
- last[ 1 ] = '\0';
/* go through each : segment of path */
while ( last[ 0 ] != '\0' && found == qfalse )
/* go through each : segment of path */
while ( last[ 0 ] != '\0' && found == qfalse )