@@ -295,7 +295,7 @@ void CON_SigTStp( int signum )
295
295
296
296
#define MAX_CMD 1024
297
297
static char exit_cmdline [MAX_CMD ] = "" ;
298
- void Sys_DoStartProcess ( char * cmdline );
298
+ void Sys_DoStartProcess ( const char * cmdline );
299
299
300
300
// single exit point (regular exit or in case of signal fault)
301
301
void Sys_Exit ( int code ) __attribute((noreturn ));
@@ -1159,7 +1159,7 @@ UGLY HACK:
1159
1159
The clean solution would be Sys_StartProcess and Sys_StartProcess_Args..
1160
1160
==================
1161
1161
*/
1162
- void Sys_DoStartProcess ( char * cmdline ) {
1162
+ void Sys_DoStartProcess ( const char * cmdline ) {
1163
1163
switch ( fork () )
1164
1164
{
1165
1165
case - 1 :
@@ -1205,9 +1205,7 @@ Sys_OpenURL
1205
1205
=================
1206
1206
*/
1207
1207
void Sys_OpenURL ( const char * url , qboolean doexit ) {
1208
- char * basepath , * homepath , * pwdpath ;
1209
- char fname [20 ];
1210
- char fn [MAX_OSPATH ];
1208
+ #ifndef DEDICATED
1211
1209
char cmdline [MAX_CMD ];
1212
1210
1213
1211
static qboolean doexit_spamguard = qfalse ;
@@ -1221,44 +1219,14 @@ void Sys_OpenURL( const char *url, qboolean doexit ) {
1221
1219
// opening an URL on *nix can mean a lot of things ..
1222
1220
// just spawn a script instead of deciding for the user :-)
1223
1221
1224
- // do the setup before we fork
1225
- // search for an openurl.sh script
1226
- // search procedure taken from Sys_LoadDll
1227
- Q_strncpyz ( fname , "openurl.sh" , 20 );
1228
-
1229
- pwdpath = Sys_Pwd ();
1230
- Com_sprintf ( fn , MAX_OSPATH , "%s/%s" , pwdpath , fname );
1231
- if ( access ( fn , X_OK ) == -1 ) {
1232
- Com_DPrintf ( "%s not found\n" , fn );
1233
- // try in home path
1234
- homepath = Cvar_VariableString ( "fs_homepath" );
1235
- Com_sprintf ( fn , MAX_OSPATH , "%s/%s" , homepath , fname );
1236
- if ( access ( fn , X_OK ) == -1 ) {
1237
- Com_DPrintf ( "%s not found\n" , fn );
1238
- // basepath, last resort
1239
- basepath = Cvar_VariableString ( "fs_basepath" );
1240
- Com_sprintf ( fn , MAX_OSPATH , "%s/%s" , basepath , fname );
1241
- if ( access ( fn , X_OK ) == -1 ) {
1242
- Com_DPrintf ( "%s not found\n" , fn );
1243
- Com_Printf ( "Can't find script '%s' to open requested URL (use +set developer 1 for more verbosity)\n" , fname );
1244
- // we won't quit
1245
- return ;
1246
- }
1247
- }
1248
- }
1222
+ Com_sprintf ( cmdline , sizeof (cmdline ), "xdg-open '%s' &" , url );
1249
1223
1250
- // show_bug.cgi?id=612
1251
1224
if ( doexit ) {
1252
1225
doexit_spamguard = qtrue ;
1253
1226
}
1254
1227
1255
- Com_DPrintf ( "URL script: %s\n" , fn );
1256
-
1257
- // build the command line
1258
- Com_sprintf ( cmdline , MAX_CMD , "%s '%s' &" , fn , url );
1259
-
1260
1228
Sys_StartProcess ( cmdline , doexit );
1261
-
1229
+ #endif
1262
1230
}
1263
1231
1264
1232
0 commit comments