mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Fix long lines in lib_calc.c
This commit is contained in:
@@ -517,13 +517,14 @@ initenv(void)
|
|||||||
if (home != NULL) {
|
if (home != NULL) {
|
||||||
free(home);
|
free(home);
|
||||||
}
|
}
|
||||||
/* try using the home directory of current effective UID from password file */
|
/* try using the home directory of current effective UID */
|
||||||
ent = (struct passwd *)getpwuid(geteuid());
|
ent = (struct passwd *)getpwuid(geteuid());
|
||||||
if (ent == NULL || ent->pw_dir == NULL || ent->pw_dir[0] == '\0') {
|
if (ent == NULL || ent->pw_dir == NULL ||
|
||||||
|
ent->pw_dir[0] == '\0') {
|
||||||
/* just assume . is home if all else fails */
|
/* just assume . is home if all else fails */
|
||||||
home = strdup(".");
|
home = strdup(".");
|
||||||
} else {
|
} else {
|
||||||
/* use home directory of current effective UID from password file */
|
/* use home directory of current effective UID */
|
||||||
home = strdup(ent->pw_dir);
|
home = strdup(ent->pw_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user