forked from Bananymous/banan-os
update main #1
|
@ -700,12 +700,18 @@ BAN::String get_prompt()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'u':
|
case 'u':
|
||||||
|
{
|
||||||
|
static char* username = nullptr;
|
||||||
|
if (username == nullptr)
|
||||||
{
|
{
|
||||||
auto* passwd = getpwuid(geteuid());
|
auto* passwd = getpwuid(geteuid());
|
||||||
if (passwd == nullptr)
|
if (passwd == nullptr)
|
||||||
break;
|
break;
|
||||||
MUST(prompt.append(passwd->pw_name));
|
username = new char[strlen(passwd->pw_name) + 1];
|
||||||
|
strcpy(username, passwd->pw_name);
|
||||||
endpwent();
|
endpwent();
|
||||||
|
}
|
||||||
|
MUST(prompt.append(username));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
Loading…
Reference in New Issue