clang on native Windows gives me this warning:

gllib\getusershell.c(115,25): warning: expression which evaluates to zero 
treated as a null pointer constant of type 'char *' 
[-Wnon-literal-null-conversion]

This patch fixes it. Collin, please consider strengthening the unit test.


2024-08-27  Bruno Haible  <br...@clisp.org>

        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/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




Reply via email to