From 3f7dd45c8f093f174dea428d2140b542166e1aa9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Oct 2023 11:42:00 +0200 Subject: [PATCH] isnan: Avoid dangerous shell coding pattern. * m4/isnand.m4 (gl_FUNC_ISNAND): Use 'test -n "$arg"', not 'test "$arg"'. * m4/isnanf.m4 (gl_FUNC_ISNANF): Likewise. * m4/isnanl.m4 (gl_FUNC_ISNANL): Likewise. --- ChangeLog | 8 ++++++++ m4/isnand.m4 | 2 +- m4/isnanf.m4 | 2 +- m4/isnanl.m4 | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a0dcd1597..df6f68ff1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-10-07 Bruno Haible + + isnan: Avoid dangerous shell coding pattern. + * m4/isnand.m4 (gl_FUNC_ISNAND): Use 'test -n "$arg"', not + 'test "$arg"'. + * m4/isnanf.m4 (gl_FUNC_ISNANF): Likewise. + * m4/isnanl.m4 (gl_FUNC_ISNANL): Likewise. + 2023-10-05 Bruno Haible doc: Mention xstrerror. diff --git a/m4/isnand.m4 b/m4/isnand.m4 index b106a5dce4..8e4f81346b 100644 --- a/m4/isnand.m4 +++ b/m4/isnand.m4 @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_ISNAND], fi fi dnl The variable gl_func_isnand set here is used by isnan.m4. - if test $gl_cv_func_isnand_no_libm = yes || test "$ISNAND_LIBM"; then + if test $gl_cv_func_isnand_no_libm = yes || test -n "$ISNAND_LIBM"; then gl_func_isnand=yes else gl_func_isnand=no diff --git a/m4/isnanf.m4 b/m4/isnanf.m4 index f30893c629..4871227ea8 100644 --- a/m4/isnanf.m4 +++ b/m4/isnanf.m4 @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_ISNANF], fi fi dnl The variable gl_func_isnanf set here is used by isnan.m4. - if test $gl_cv_func_isnanf_no_libm = yes || test "$ISNANF_LIBM"; then + if test $gl_cv_func_isnanf_no_libm = yes || test -n "$ISNANF_LIBM"; then save_LIBS="$LIBS" LIBS="$LIBS $ISNANF_LIBM" gl_ISNANF_WORKS diff --git a/m4/isnanl.m4 b/m4/isnanl.m4 index 203ab325f5..326d5fe11f 100644 --- a/m4/isnanl.m4 +++ b/m4/isnanl.m4 @@ -16,7 +16,7 @@ AC_DEFUN([gl_FUNC_ISNANL], fi fi dnl The variable gl_func_isnanl set here is used by isnan.m4. - if test $gl_cv_func_isnanl_no_libm = yes || test "$ISNANL_LIBM"; then + if test $gl_cv_func_isnanl_no_libm = yes || test -n "$ISNANL_LIBM"; then save_LIBS="$LIBS" LIBS="$LIBS $ISNANL_LIBM" gl_FUNC_ISNANL_WORKS -- 2.39.5