]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - misc/tdlint
ncurses 6.2 - patch 20211016
[ncurses.git] / misc / tdlint
index 287b8e1c163ad398acd1cf9b733cb2c14cf503cc..8ff5a40bffee5b194c78079eb1a71e4a0fa5fb21 100755 (executable)
@@ -1,24 +1,36 @@
 #!/bin/sh
-################################################################################
-# Copyright 1996 by Thomas E. Dickey <dickey@clark.net>                        #
-# All Rights Reserved.                                                         #
-#                                                                              #
-# Permission to use, copy, modify, and distribute this software and its        #
-# documentation for any purpose and without fee is hereby granted, provided    #
-# that the above copyright notice appear in all copies and that both that      #
-# copyright notice and this permission notice appear in supporting             #
-# documentation, and that the name of the above listed copyright holder(s) not #
-# be used in advertising or publicity pertaining to distribution of the        #
-# software without specific, written prior permission. THE ABOVE LISTED        #
-# COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,    #
-# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT #
-# SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL,        #
-# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM   #
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE   #
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR    #
-# PERFORMANCE OF THIS SOFTWARE.                                                #
-################################################################################
-# $Id: tdlint,v 1.3 1996/07/15 00:47:21 tom Exp $
+##############################################################################
+# Copyright 2020,2021 Thomas E. Dickey                                       #
+# Copyright 1998,2000 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"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey <dickey@clark.net> 1996
+#
+# $Id: tdlint,v 1.8 2021/09/04 15:55:29 tom Exp $
 #
 # Lint-script that allows user's own lint libraries, in addition to the ones
 # installed in the system.
@@ -33,14 +45,16 @@ if test -z "$ARCH" ; then
        exit 1
 else
        case $ARCH in
-       AIX)    set - $* -Nn4000
+       AIX)    set - "$@" -Nn4000
+               ;;
+       IRIX)   set - "$@" -n -lc
                ;;
-       IRIX)   set - $* -n -lc
+       FreeBSD) set - "$@" -g -p -u -v -z
                ;;
        SunOS)
                case `uname -r` in
                5.*)    ARCH=Solaris
-                       set - $* -n -lc
+                       set - "$@" -n -lc
                        ;;
                esac
                ;;
@@ -49,7 +63,7 @@ fi
 # LIBDIR=$HOME/lib/$ARCH/lint ;export LIBDIR
 for p in $HOME/lib/$ARCH/lint /usr/lib/lint /usr/lib
 do
-       if [ -d $p ]
+       if [ -d "$p" ]
        then
                DIRS="$DIRS $p"
        fi
@@ -60,15 +74,15 @@ do
        case $1 in
        -D*\"*) ;;
        -L*)
-               DIRS="`echo $1|sed -e 's/^-L//'` $DIRS"
+               DIRS="`echo "$1"|sed -e 's/^-L//'` $DIRS"
                ;;
        -l*)
-               lib="llib-l`echo $1 | sed -e 's/^-l//'`.ln"
+               lib="llib-l`echo "$1" | sed -e 's/^-l//'`.ln"
                found=no
                for p in $DIRS
                do
-                       echo -n testing $p/$lib
-                       if [ -f $p/$lib ]
+                       printf "testing %s" "$p/$lib"
+                       if [ -f "$p/$lib" ]
                        then
                                LIBS="$LIBS $p/$lib"
                                echo " (ok)"
@@ -97,4 +111,4 @@ do
        shift
 done
 #
-eval lint $OPT $FILES $LIBS
+exec lint $OPT $FILES $LIBS