mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
logit: fall back to package name if $LOGNAME and $USER are unset
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+7
-2
@@ -208,8 +208,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (!ident)
|
||||
ident = getenv("LOGNAME") ?: getenv("USER");
|
||||
if (!ident) {
|
||||
ident = getenv("LOGNAME");
|
||||
if (!ident)
|
||||
ident = getenv("USER");
|
||||
if (!ident)
|
||||
ident = PACKAGE_NAME;
|
||||
}
|
||||
|
||||
if (optind < argc) {
|
||||
size_t pos = 0, len = sizeof(buf);
|
||||
|
||||
Reference in New Issue
Block a user