Skip to content

Commit

Permalink
src/useradd.c: create_home(): Use !streq() instead of its pattern
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar committed Jan 18, 2025
1 parent 840a40d commit b19cf89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/useradd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2259,9 +2259,9 @@ static void create_home (void)
*/
for (cp = strtok(bhome, "/"); cp != NULL; cp = strtok(NULL, "/")) {
/* Avoid turning a relative path into an absolute path. */
if (bhome[0] == '/' || strlen(path) != 0) {
if (bhome[0] == '/' || !streq(path, ""))
strcat(path, "/");
}

strcat(path, cp);
if (access(path, F_OK) == 0) {
continue;
Expand Down

0 comments on commit b19cf89

Please sign in to comment.