From 262beaeef666d5f2caf5837f38692d708423705a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 27 Aug 2024 22:17:18 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/getusershell.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e061d0602..80fa6b9e61 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 -- 2.39.5