Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 533c4cb4 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

WIP: Always patch PATH

parent 7810cbff
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!144Resolve "Write MKV tags without mkvpropedit as a dependency for the AppImage"
...@@ -243,16 +243,19 @@ static inline void ...@@ -243,16 +243,19 @@ static inline void
___resolve_path(void) ___resolve_path(void)
{ {
const char *env_PATH = getenv("PATH"); const char *env_PATH = getenv("PATH");
if (___is_appimage) { RETURN_UNLESS(env_PATH, "Failed to get PATH in env", NOTHING);
char new_path[PATH_MAX]; char new_path[PATH_MAX];
char exe_path[LKT_LINE_MAX]; char exe_path[LKT_LINE_MAX];
GOTO_IF(read_self_exe(exe_path, LKT_LINE_MAX), "Failed to get exe path", error); GOTO_IF(read_self_exe(exe_path, LKT_LINE_MAX), "Failed to get exe path", error);
char *self_dir = dirname(exe_path); char *self_dir = dirname(exe_path);
LOG_DEBUG("INIT", "Try to patch PATH with %s", self_dir);
safe_snprintf(new_path, PATH_MAX, "%s:%s", self_dir, env_PATH); safe_snprintf(new_path, PATH_MAX, "%s:%s", self_dir, env_PATH);
GOTO_IF(setenv("PATH", new_path, 1), "Failed to set new PATH", error); GOTO_IF(setenv("PATH", new_path, 1), "Failed to set new PATH", error);
} env_PATH = getenv("PATH");
error:
LOG_DEBUG("INIT", "PATH is: %s", env_PATH); LOG_DEBUG("INIT", "PATH is: %s", env_PATH);
return;
error:
LOG_DEBUG("INIT", "Failed to patch PATH, it will remain as: %s", env_PATH);
} }
int int
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter