Skip to content

Commit

Permalink
Merge pull request #1780 from warmenhoven/warmenhoven/pr/docs-889
Browse files Browse the repository at this point in the history
Make sure variables based on $PWD are properly quoted
  • Loading branch information
fpscan committed Jan 9, 2024
2 parents f4fc2a5 + 12ab35b commit d3486e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions libretro-build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ libretro_build_core() {

if [ -n "${LIBRETRO_LOG_MODULE}" ]; then
printf -v log_module "$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_MODULE" "$1"
[ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_module
[ -z "$LIBRETRO_LOG_APPEND" ] && : > "$log_module"
fi

eval "core_name=\${libretro_${1}_name:-$1}"
Expand Down Expand Up @@ -327,13 +327,13 @@ libretro_build_core() {
lecho "Building ${1}..."
if [ -n "$log_module" ]; then
exec 6>&1
echo "Building ${1}..." >> $log_module
echo "Building ${1}..." >> "$log_module"

# TODO: Possibly a shell function for tee?
if [[ -n "$LIBRETRO_DEVELOPER" && -n "${cmd_tee:=$(find_tool "tee")}" ]]; then
exec > >($cmd_tee -a $log_module)
exec > >($cmd_tee -a "$log_module")
else
exec > $log_module
exec > "$log_module"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion libretro-build-ios-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ else
fi
fi

platform=ios-arm64 ${BASE_DIR}/libretro-build.sh $@
platform=ios-arm64 "${BASE_DIR}/libretro-build.sh" $@
2 changes: 1 addition & 1 deletion libretro-build-tvos-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ else
fi
fi

platform=tvos-arm64 ${BASE_DIR}/libretro-build.sh $@
platform=tvos-arm64 "${BASE_DIR}/libretro-build.sh" $@
12 changes: 6 additions & 6 deletions script-modules/log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ secho() {
}

lecho() {
[ -n "$LIBRETRO_LOG_SUPER" ] && echo "$@" >> $log_super
[ -n "$LIBRETRO_LOG_SUPER" ] && echo "$@" >> "$log_super"
}

lsecho() {
echo "$@"
[ -n "$log_file_only" ] && echo "$@" >&6
[ -n "$LIBRETRO_LOG_SUPER" ] && echo "$@" >> $log_super
[ -n "$LIBRETRO_LOG_SUPER" ] && echo "$@" >> "$log_super"
}

echo_cmd() {
Expand All @@ -39,7 +39,7 @@ libretro_log_init() {
if [ -n "$LIBRETRO_LOG_SUPER" ]; then
log_super="$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_SUPER"
# Redirecting : avoids dependency on trunc(1)
[ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_super
[ -z "$LIBRETRO_LOG_APPEND" ] && : > "$log_super"
fi
# Module logs are truncated as they're opened in log_module_start
}
Expand All @@ -52,13 +52,13 @@ log_module_start() {
exec 6>&1 7>&2

# Redirecting : avoids dependency on trunc(1)
[ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_module
[ -z "$LIBRETRO_LOG_APPEND" ] && : > "$log_module"

# Output to screen and logfile in developer mode (if possible)
if [[ -n "$LIBRETRO_DEVELOPER" && -n "${log_tee:=$(find_tool "tee")}" ]]; then
exec >> $($log_tee -a $log_module) 2>&1
exec >> $($log_tee -a "$log_module") 2>&1
else
exec >> $log_module 2>&1
exec >> "$log_module" 2>&1
log_file_only=1
fi
fi
Expand Down

0 comments on commit d3486e9

Please sign in to comment.