Skip to content

Commit 2e8d80a

Browse files
committed
Simplify string comparisons
1 parent f6263fc commit 2e8d80a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/core/manager.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ static gchar** _manager_generateEnvv(Manager* manager, InterposeMethod interpose
460460
for (int i = 0; paths != NULL && paths[i] != NULL; i++) {
461461
GString* pathBuf = g_string_new(NULL);
462462

463-
if (!g_ascii_strncasecmp(paths[i], "~/", 2)) {
463+
if (g_str_has_prefix(paths[i], "~/")) {
464464
g_string_printf(pathBuf, "%s%s", g_get_home_dir(), &paths[i][1]);
465-
} else if (!g_ascii_strncasecmp(paths[i], "~", 1)) {
465+
} else if (g_str_has_prefix(paths[i], "~")) {
466466
g_string_printf(pathBuf, "/home/%s", &paths[i][1]);
467467
} else {
468468
g_string_printf(pathBuf, "%s", paths[i]);

0 commit comments

Comments
 (0)