Skip to content

Commit

Permalink
Add double quotes to prevent globbing and word splitting
Browse files Browse the repository at this point in the history
This fixes some issues which were reported by Codacy.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jun 11, 2024
1 parent b9b2aea commit 2d21fa7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions doc/generate_manpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ if [[ -z "${asciidoc}" ]] || [[ -z "${xsltproc}" ]]; then
else
for src in *.asc; do
pagename=${src/.asc/}
(${asciidoc} -d manpage ${src} &&
${asciidoc} -d manpage -b docbook ${src} &&
${xsltproc} --nonet ${man_xslt} ${pagename}.xml) ||
(${asciidoc} -d manpage "${src}" &&
${asciidoc} -d manpage -b docbook "${src}" &&
${xsltproc} --nonet ${man_xslt} "${pagename}".xml) ||
echo "Error generating ${pagename}"
done
fi
Expand Down
40 changes: 20 additions & 20 deletions unittest/fuzzers/oss-fuzz-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
#
################################################################################

cd $SRC/leptonica
cd "$SRC"/leptonica
./autogen.sh
./configure --disable-shared
make SUBDIRS=src install -j$(nproc)
make SUBDIRS=src install -j"$(nproc)"
ldconfig

cd $SRC/tesseract
cd "$SRC"/tesseract
./autogen.sh
CXXFLAGS="$CXXFLAGS -D_GLIBCXX_DEBUG" ./configure --disable-graphics --disable-shared
make -j$(nproc)
make -j"$(nproc)"

# Get the models which are needed for the fuzzers.

mkdir -p $OUT/tessdata
mkdir -p "$OUT"/tessdata
(
cd $OUT/tessdata
cd "$OUT"/tessdata
test -f eng.traineddata || \
curl -L -O https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata
)
Expand All @@ -43,20 +43,20 @@ LEPTONICA_CFLAGS=$(pkg-config --cflags lept)
LEPTONICA_LIBS=$(pkg-config --static --libs lept)
LIBTIFF_LIBS=$(pkg-config --static --libs libtiff-4 | sed 's/ -lm//')

$CXX $CXXFLAGS \
-I $SRC/tesseract/include \
$SRC/tesseract/unittest/fuzzers/fuzzer-api.cpp -o $OUT/fuzzer-api \
$SRC/tesseract/.libs/libtesseract.a \
$LEPTONICA_CFLAGS \
-Wl,-Bstatic $LEPTONICA_LIBS $LIBTIFF_LIBS -Wl,-Bdynamic \
$LIB_FUZZING_ENGINE
$CXX "$CXXFLAGS" \
-I "$SRC"/tesseract/include \
"$SRC"/tesseract/unittest/fuzzers/fuzzer-api.cpp -o "$OUT"/fuzzer-api \
"$SRC"/tesseract/.libs/libtesseract.a \
"$LEPTONICA_CFLAGS" \
-Wl,-Bstatic "$LEPTONICA_LIBS" "$LIBTIFF_LIBS" -Wl,-Bdynamic \
"$LIB_FUZZING_ENGINE"

$CXX $CXXFLAGS \
$CXX "$CXXFLAGS" \
-DTESSERACT_FUZZER_WIDTH=512 \
-DTESSERACT_FUZZER_HEIGHT=256 \
-I $SRC/tesseract/include \
$SRC/tesseract/unittest/fuzzers/fuzzer-api.cpp -o $OUT/fuzzer-api-512x256 \
$SRC/tesseract/.libs/libtesseract.a \
$LEPTONICA_CFLAGS \
-Wl,-Bstatic $LEPTONICA_LIBS $LIBTIFF_LIBS -Wl,-Bdynamic \
$LIB_FUZZING_ENGINE
-I "$SRC"/tesseract/include \
"$SRC"/tesseract/unittest/fuzzers/fuzzer-api.cpp -o "$OUT"/fuzzer-api-512x256 \
"$SRC"/tesseract/.libs/libtesseract.a \
"$LEPTONICA_CFLAGS" \
-Wl,-Bstatic "$LEPTONICA_LIBS" "$LIBTIFF_LIBS" -Wl,-Bdynamic \
"$LIB_FUZZING_ENGINE"

0 comments on commit 2d21fa7

Please sign in to comment.