libncurses: Import https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz changes
Change-Id: I3433d30ca01359fd2e3623ede96b531f0b39cbfa
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/include/edit_cfg.sh b/include/edit_cfg.sh
index 8d64fee..559b157 100755
--- a/include/edit_cfg.sh
+++ b/include/edit_cfg.sh
@@ -1,7 +1,8 @@
#!/bin/sh
-# $Id: edit_cfg.sh,v 1.12 2001/12/23 00:52:40 tom Exp $
+# $Id: edit_cfg.sh,v 1.16 2022/07/16 18:02:32 tom Exp $
##############################################################################
-# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. #
+# Copyright 2020,2022 Thomas E. Dickey #
+# Copyright 1998-2001,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -38,15 +39,16 @@
#
BAK=save$$
TMP=edit$$
-trap "rm -f $BAK $TMP" 0 1 2 5 15
+trap "rm -f $BAK $TMP; exit 1" 1 2 3 15
+trap "rm -f $BAK $TMP" 0
for name in \
HAVE_TCGETATTR \
HAVE_TERMIOS_H \
HAVE_TERMIO_H \
BROKEN_LINKER
do
- mv $2 $BAK
- if ( grep "[ ]$name[ ]" $1 2>&1 >$TMP )
+ mv "$2" "$BAK"
+ if ( grep "[ ]${name}[ ]" "$1" >$TMP 2>&1 )
then
value=1
else
@@ -57,11 +59,11 @@
-e "s@#define ${name}.*\$@#define $name $value@" \
-e "s@#if $name\$@#if $value /* $name */@" \
-e "s@#if !$name\$@#if $value /* !$name */@" \
- $BAK >$2
- if (cmp -s $2 $BAK)
+ "$BAK" >"$2"
+ if (cmp -s "$2" "$BAK")
then
- mv $BAK $2
+ mv "$BAK" "$2"
else
- rm -f $BAK
+ rm -f "$BAK"
fi
done