Fix for starting server from the current directory.

This commit is contained in:
Huw D M Davies 2000-08-14 13:26:30 +00:00 committed by Alexandre Julliard
parent d80ce30090
commit 94237ded13
1 changed files with 7 additions and 7 deletions

View File

@ -361,6 +361,7 @@ static void start_server( const char *oldcwd )
strcpy( p, "/server/wineserver" ); strcpy( p, "/server/wineserver" );
execl( path, "wineserver", NULL ); execl( path, "wineserver", NULL );
} }
free(path);
} }
/* now try the path */ /* now try the path */
@ -369,13 +370,12 @@ static void start_server( const char *oldcwd )
/* and finally the current dir */ /* and finally the current dir */
if (!(path = malloc( strlen(oldcwd) + 20 ))) if (!(path = malloc( strlen(oldcwd) + 20 )))
fatal_error( "out of memory\n" ); fatal_error( "out of memory\n" );
if ((p = strrchr( strcpy( path, oldcwd ), '/' ))) p = strcpy( path, oldcwd ) + strlen( oldcwd );
{ strcpy( p, "/wineserver" );
strcpy( p, "/wineserver" ); execl( path, "wineserver", NULL );
execl( path, "wineserver", NULL ); strcpy( p, "/server/wineserver" );
strcpy( p, "/server/wineserver" ); execl( path, "wineserver", NULL );
execl( path, "wineserver", NULL ); free(path);
}
fatal_error( "could not exec wineserver\n" ); fatal_error( "could not exec wineserver\n" );
} }
started = 1; started = 1;