summaryrefslogtreecommitdiff
path: root/mk/buildlink3/quotearg
blob: 0cdbe2438ec81f28595c19036dd9c63b6592d065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# $NetBSD: quotearg,v 1.2 2004/03/13 03:41:13 uebayasi Exp $
#
# Returns $qarg, which contains a correctly-quoted $arg.  Also sets
# $quotedarg to "yes" if the $arg needed to be quoted.
#
case $arg in
*[\`\"\$\\]*)
	qarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
	quotedarg=yes
	;;
*)
	qarg="$arg"
	;;
esac
case $qarg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
	qarg="\"$qarg\""
	quotedarg=yes
	;;
esac