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/misc/shlib b/misc/shlib
index a3ed810..7b93d17 100755
--- a/misc/shlib
+++ b/misc/shlib
@@ -1,6 +1,7 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.                #
+# Copyright 2020,2021 Thomas E. Dickey                                       #
+# Copyright 1998-2005,2007 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"), #
@@ -29,7 +30,7 @@
 #
 # Author: Thomas E. Dickey <dickey@clark.net> 1996
 #
-# $Id: shlib,v 1.11 2007/01/13 17:09:52 tom Exp $
+# $Id: shlib,v 1.14 2021/09/04 15:55:29 tom Exp $
 # Use this script as a wrapper when running executables linked to shared
 # libraries on systems that use the $LD_LIBRARY_PATH variable and don't embed
 # the soname's path within the linked executable (such as IRIX), e.g,
@@ -80,7 +81,7 @@
 for p in lib ../lib ../../lib ../../../lib
 do
 	if test -d $p; then
-		q=`cd $p; pwd`
+		q=`cd $p || exit; pwd`
 		break
 	elif test -f configure && test ! -d ../$p ; then
 		break
@@ -101,7 +102,7 @@
 	elif test -n "$LD_LIBRARY_PATH"; then
 		system=unix
 	else
-		for r in $q/*.*
+		for r in "$q"/*.*
 		do
 			if test -f "$r"
 			then