From 985c096f6f43b2b3156350711070df4b2641425a Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 5 Jan 2010 21:23:58 +0000 Subject: [PATCH] znc-buildmod: Don't choke on spaces In shell scripts you always have to be careful about spaces. Better at some "" too much than one too few. Now spaces in the pathname for the module and spaces in some other paths should work correctly. Thanks to Nirjen for noticing this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1689 726aef4b-f618-498e-8847-2d620e286838 --- znc-buildmod.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/znc-buildmod.in b/znc-buildmod.in index b8fa2301..bfb1dd09 100755 --- a/znc-buildmod.in +++ b/znc-buildmod.in @@ -25,8 +25,8 @@ check_binary() fi } -check_binary ${SED} -check_binary ${ZNC_CONFIG} "Please (re)install ZNC." +check_binary "${SED}" +check_binary "${ZNC_CONFIG}" "Please (re)install ZNC." if test "x$CXX" = "x" ; then CXX=`${ZNC_CONFIG} --cxx` @@ -50,7 +50,7 @@ LDFLAGS="`${ZNC_CONFIG} --libznc` $LDFLAGS" # Get the first word and strip away the first two chars (which is -I) INC_PATH=`echo ${INCLUDES} | ${SED} 's: .*::' | ${SED} 's:^..::'` -if test ! -d ${INC_PATH}; then +if test ! -d "${INC_PATH}"; then echo "${ERROR} Unable to find znc include dir [${INC_PATH}]. Please (re)install ZNC." exit 1 fi @@ -63,14 +63,14 @@ do MOD="${FILE%.cpp}" MOD="${MOD%.cc}" - if test ! -f ${FILE}; then - echo "${ERROR} Building ${MOD}.so... File not found" + if test ! -f "${FILE}"; then + echo "${ERROR} Building \"${MOD}.so\"... File not found" else - printf "Building ${MOD}.so... " - if ${CXX} ${CXXFLAGS} ${INCLUDES} ${LDFLAGS} ${LIBS} -shared -o ${MOD}.so ${FILE} ; then + printf "Building \"${MOD}.so\"... " + if ${CXX} ${CXXFLAGS} ${INCLUDES} ${LDFLAGS} ${LIBS} -shared -o "${MOD}.so" "${FILE}" ; then echo "${OK}" else - echo "${ERROR} Error while building ${MOD}.so" + echo "${ERROR} Error while building \"${MOD}.so\"" exit 1 fi fi