o fixed "-d" flag was ignored (directory was always created)

o fixed directory creation failed when relative path was used
	(ie path containing ".." or ".")
This commit is contained in:
Jeff Hill
1996-11-05 18:17:08 +00:00
parent 5f2999d9c4
commit d8fdf046d1

View File

@@ -44,16 +44,24 @@ do
done
if [ ! -d "${INSTALL_DIR}" ] ;then
if [ "${CREATE_DIR}" ] ;then
if [ ${CREATE_DIR} != "0" ] ;then
OLDIFS=${IFS}
IFS=/
DIRNAME=
for DIR in ${INSTALL_DIR}
do
DIRNAME=${DIRNAME}/${DIR}
if [ ! -d "${DIRNAME}" ] ;then
mkdir "${DIRNAME}"
fi
if [ "${DIR}" = "." ] || [ "${DIR}" = ".." ] ;then
if [ "${DIRNAME}" = "" ] ;then
DIRNAME=${DIR}
else
DIRNAME=${DIRNAME}/${DIR}
fi
else
DIRNAME=${DIRNAME}/${DIR}
if [ ! -d "${DIRNAME}" ] ;then
mkdir "${DIRNAME}"
fi
fi
done
IFS=${OLDIFS}
else