File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -353,8 +353,8 @@ rc_sys(void)
353353char *
354354rc_sysconfdir_get (void ) {
355355 static char path [PATH_MAX ] = { 0 };
356- if (geteuid () != 0 ) {
357- if (! * path ) {
356+ if (! * path ) {
357+ if (geteuid () != 0 ) {
358358 char * config_path ;
359359 if ((config_path = getenv ("XDG_CONFIG_HOME" ))) {
360360 snprintf (path , PATH_MAX , "%s" , config_path );
@@ -363,18 +363,18 @@ rc_sysconfdir_get(void) {
363363 } else {
364364 exit (1 );
365365 }
366+ } else {
367+ snprintf (path , PATH_MAX , "%s" , RC_SYSCONFDIR );
366368 }
367- return path ;
368- } else {
369- return RC_SYSCONFDIR ;
370369 }
370+ return path ;
371371}
372372
373373char *
374374rc_svcdir_get (void ) {
375375 static char path [PATH_MAX ] = { 0 };
376- if (geteuid () != 0 ) {
377- if (! * path ) {
376+ if (! * path ) {
377+ if (geteuid () != 0 ) {
378378 char * config_path ;
379379 if ((config_path = getenv ("XDG_RUNTIME_DIR" )) ||
380380 (config_path = getenv ("XDG_DATA_HOME" ))) {
@@ -385,11 +385,11 @@ rc_svcdir_get(void) {
385385 } else {
386386 exit (1 );
387387 }
388+ } else {
389+ snprintf (path , PATH_MAX , "%s" , RC_SVCDIR );
388390 }
389- return path ;
390- } else {
391- return RC_SVCDIR ;
392391 }
392+ return path ;
393393}
394394
395395char *
You can’t perform that action at this time.
0 commit comments