Skip to content

Commit

Permalink
getenv is buggy. so replaced with GLib.Environment.get_variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Aug 21, 2024
1 parent 6b4f437 commit 3bbab97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/ccode.vala
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,4 @@ private extern void exit(int status);
private extern void save_env();
private extern void clear_env();
private extern void restore_env();
private extern string getenv(string name);
private extern int setenv(string name, string value, int override);
2 changes: 1 addition & 1 deletion src/operations/package-manager/template.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static int template_main (string[] args) {
}

private string get_gitconfig_variable (string variable) {
string gitconfig = srealpath (getenv ("HOME") + "/.gitconfig");
string gitconfig = srealpath (GLib.Environment.get_variable ("HOME") + "/.gitconfig");
if (isfile (gitconfig)) {
info (_ ("Reading gitconfig: %s").printf (gitconfig));
foreach (string line in readfile (gitconfig).split ("\n")) {
Expand Down
6 changes: 3 additions & 3 deletions src/settings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private static void settings_init () {
}else {
warning (_ ("Config file does not exists: %s").printf (CONFIG));
}
if (getenv ("USE") != null) {
set_value ("USE", getenv ("USE"));
if (GLib.Environment.get_variable ("USE") != null) {
set_value ("USE", GLib.Environment.get_variable ("USE"));
}else {
area = config_yaml.get_area (config_yaml.data, "ymp");
set_value ("USE", config_yaml.get_value (area, "use"));
Expand Down Expand Up @@ -159,7 +159,7 @@ private static void parse_args (string[] args) {
}
}
}
if (getenv ("NO_COLOR") != null) {
if (GLib.Environment.get_variable ("NO_COLOR") != null) {
set_bool ("no-color", true);
}
}

0 comments on commit 3bbab97

Please sign in to comment.