Error out if a path has a trailing slash, which makes awk enter an

infinite loop while creating set lists.
This commit is contained in:
njoly 2013-03-12 13:08:00 +00:00
parent 93b2a5c31b
commit c100454ec7
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: getdirs.awk,v 1.5 2012/02/08 16:51:09 njoly Exp $
# $NetBSD: getdirs.awk,v 1.6 2013/03/12 13:08:00 njoly Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
@ -59,6 +59,15 @@ function dirname(file) \
exit 1
}
# error if path has a trailing slash
#
/\/$/ \
{
print "Unsupported path with trailing slash:" >"/dev/stderr"
print >"/dev/stderr"
exit 1
}
# all other lines are parsed
#
{