From: Bruno Haible Date: Tue, 27 Aug 2024 20:17:18 +0000 (+0200) Subject: getusershell: Don't completely ignore lines that contain a comment. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8bcadf39ecc6c8729fc809362ba6ebde28667bd6;p=gnulib.git getusershell: Don't completely ignore lines that contain a comment. * lib/getusershell.c (getusershell): Truncate the line where a comment starts, instead of ignoring the line entirely. --- diff --git a/ChangeLog b/ChangeLog index 51e78323e0..9ffb43fd6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-08-27 Bruno Haible + + getusershell: Don't completely ignore lines that contain a comment. + * lib/getusershell.c (getusershell): Truncate the line where a comment + starts, instead of ignoring the line entirely. + 2024-08-27 Bruno Haible fts: Don't assume that a pointer is as wide as a 'long'. diff --git a/lib/getusershell.c b/lib/getusershell.c index 356b8023d5..817318327b 100644 --- a/lib/getusershell.c +++ b/lib/getusershell.c @@ -112,7 +112,7 @@ getusershell (void) if (comment != NULL) { /* Trim the comment mark. */ - comment = '\0'; + *comment = '\0'; end = comment; } else