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 6cb49dc commit 08e9ba8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 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
24 changes: 12 additions & 12 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 @@ -44,19 +44,19 @@ 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 \
-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 \
-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 \
-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

1 comment on commit 08e9ba8

@vincenthc13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Please sign in to comment.