diff --git a/apps/sh.cpp b/apps/sh.cpp index 0a25f6c4..2791465f 100644 --- a/apps/sh.cpp +++ b/apps/sh.cpp @@ -71,12 +71,9 @@ Result luna_main(int argc, char** argv) if (getuid() == 0) prompt_end = '#'; - username = getenv("USER"); - if (!username) - { - struct passwd* pw = getpwuid(getuid()); - if (pw) { username = pw->pw_name; } - } + struct passwd* pw = getpwuid(getuid()); + if (pw) { username = pw->pw_name; } + else { username = getenv("USER"); } } while (1)