From 9eb802a76ed82fdcbeca4d6d9f95c6a6397ee881 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 22 Apr 2025 05:34:17 +0300
Subject: [PATCH 32/32] Autotools binary wrappers: Remove x-prefixing

See RM #1315

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 bootstrap/fcgui.in     | 36 ++++++++++++++++++------------------
 bootstrap/fcruledit.in | 16 ++++++++--------
 bootstrap/fcruleup.in  | 12 ++++++------
 bootstrap/fcser.in     | 16 ++++++++--------
 4 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/bootstrap/fcgui.in b/bootstrap/fcgui.in
index 000434b355..dad1410d08 100644
--- a/bootstrap/fcgui.in
+++ b/bootstrap/fcgui.in
@@ -18,55 +18,55 @@ BUILDDIR=`dirname $0`
 PROGNAME=freeciv
 EXENAME=${PROGNAME}@EXEEXT@
 
-if test "x$1" = "x--gui" ; then
-  if test "x$2" != "x" ; then
-    EXENAME=${PROGNAME}-$2@EXEEXT@
+if test "$1" = "--gui" ; then
+  if test "$2" != "" ; then
+    EXENAME="${PROGNAME}-$2@EXEEXT@"
     shift
   fi
   shift
 fi
 
-if test -x "$BUILDDIR/client/$EXENAME" ; then
-  EXE=$BUILDDIR/client/$EXENAME
-elif test -x "$BUILDDIR/$EXENAME" ; then
-  EXE=$BUILDDIR/$EXENAME
+if test -x "${BUILDDIR}/client/${EXENAME}" ; then
+  EXE="${BUILDDIR}/client/${EXENAME}"
+elif test -x "${BUILDDIR}/${EXENAME}" ; then
+  EXE="${BUILDDIR}/${EXENAME}"
 else
-  echo "Unable to find client executable: $EXENAME"
+  echo "Unable to find client executable: ${EXENAME}"
   echo "Searching for freeciv clients ..."
 
-  EXE=`ls -1 "$BUILDDIR/${PROGNAME}-"* "$BUILDDIR/client/${PROGNAME}-"* 2> /dev/null |\
+  EXE=`ls -1 "${BUILDDIR}/${PROGNAME}-"* "${BUILDDIR}/client/${PROGNAME}-"* 2> /dev/null |\
   while read program ; do
-    if test -x "$program" ; then
-      echo $program
+    if test -x "${program}" ; then
+      echo ${program}
       break
     fi
   done`
 
-  if test -x "$EXE" ; then
-    echo "... using $EXE"
+  if test -x "${EXE}" ; then
+    echo "... using ${EXE}"
   else
     echo "No client found"
     exit 1
   fi
 fi
 
-if test "x$FREECIV_DATA_PATH" = "x" ; then
+if test "${FREECIV_DATA_PATH}" = "" ; then
   FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@"
 fi
 FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data"
 export FREECIV_DATA_PATH
 
-if test "x$FREECIV_SAVE_PATH" = "x" ; then
+if test "${FREECIV_SAVE_PATH}" = "" ; then
   FREECIV_SAVE_PATH=".@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@saves"
 fi
 FREECIV_SAVE_PATH="${FREECIV_SAVE_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_PATH_SEPARATOR@@top_srcdir@"
 export FREECIV_SAVE_PATH
 
-if test "x$FREECIV_SCENARIO_PATH" = "x" ; then
+if test "${FREECIV_SCENARIO_PATH}" = "" ; then
   FREECIV_SCENARIO_PATH=".@HOST_PATH_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@scenarios"
 fi
 FREECIV_SCENARIO_PATH="${FREECIV_SCENARIO_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios"
 export FREECIV_SCENARIO_PATH
 
-echo "Running $EXE"
-exec "$EXE" ${1+"$@"}
+echo "Running ${EXE}"
+exec "${EXE}" ${1+"$@"}
diff --git a/bootstrap/fcruledit.in b/bootstrap/fcruledit.in
index 76fba941ec..28135aa077 100644
--- a/bootstrap/fcruledit.in
+++ b/bootstrap/fcruledit.in
@@ -18,20 +18,20 @@ BUILDDIR=`dirname $0`
 PROGNAME=freeciv-ruledit
 EXENAME=${PROGNAME}@EXEEXT@
 
-if test -x "$BUILDDIR/tools/ruledit/$EXENAME" ; then
-  EXE=$BUILDDIR/tools/ruledit/$EXENAME
-elif test -x "$BUILDDIR/$EXENAME" ; then
-  EXE=$BUILDDIR/$EXENAME
+if test -x "${BUILDDIR}/tools/ruledit/${EXENAME}" ; then
+  EXE="${BUILDDIR}/tools/ruledit/${EXENAME}"
+elif test -x "${BUILDDIR}/${EXENAME}" ; then
+  EXE="${BUILDDIR}/${EXENAME}"
 else
-  echo "Unable to find rule editor executable: $EXENAME"
+  echo "Unable to find rule editor executable: ${EXENAME}"
   exit 1
 fi
 
-if test "x$FREECIV_DATA_PATH" = "x" ; then
+if test "${FREECIV_DATA_PATH}" = "" ; then
   FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@"
 fi
 FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data"
 export FREECIV_DATA_PATH
 
-echo "Running $EXE"
-exec "$EXE" ${1+"$@"}
+echo "Running ${EXE}"
+exec "${EXE}" ${1+"$@"}
diff --git a/bootstrap/fcruleup.in b/bootstrap/fcruleup.in
index 6e5e445fad..9802e123ce 100644
--- a/bootstrap/fcruleup.in
+++ b/bootstrap/fcruleup.in
@@ -18,18 +18,18 @@ BUILDDIR=`dirname $0`
 PROGNAME=freeciv-ruleup
 EXENAME=${PROGNAME}@EXEEXT@
 
-if test "x$FREECIV_DATA_PATH" = "x" ; then
+if test "${FREECIV_DATA_PATH}" = "" ; then
   FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data"
 fi
 FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data"
 export FREECIV_DATA_PATH
 
-[ -x $BUILDDIR@HOST_DIR_SEPARATOR@tools@HOST_DIR_SEPARATOR@$EXENAME ] && EXE=$BUILDDIR@HOST_DIR_SEPARATOR@tools@HOST_DIR_SEPARATOR@$EXENAME
-[ -x $BUILDDIR@HOST_DIR_SEPARATOR@$EXENAME ] && EXE=$BUILDDIR@HOST_DIR_SEPARATOR@$EXENAME
+[ -x "${BUILDDIR}@HOST_DIR_SEPARATOR@tools@HOST_DIR_SEPARATOR@${EXENAME}" ] && EXE="${BUILDDIR}@HOST_DIR_SEPARATOR@tools@HOST_DIR_SEPARATOR@${EXENAME}"
+[ -x "${BUILDDIR}@HOST_DIR_SEPARATOR@${EXENAME}" ] && EXE="${BUILDDIR}@HOST_DIR_SEPARATOR@${EXENAME}"
 
-if [ "$EXE" = "" ]; then
-  echo $0: Unable to find rule upgrader executable $EXENAME.
+if [ "${EXE}" = "" ]; then
+  echo $0: Unable to find rule upgrader executable ${EXENAME}.
   exit 1
 fi
 
-exec $EXE ${1+"$@"}
+exec "${EXE}" ${1+"$@"}
diff --git a/bootstrap/fcser.in b/bootstrap/fcser.in
index 72c27dc4df..8f64d7f884 100644
--- a/bootstrap/fcser.in
+++ b/bootstrap/fcser.in
@@ -17,30 +17,30 @@
 BUILDDIR=`dirname $0`
 EXENAME=freeciv-server@EXEEXT@
 
-if test "x$FREECIV_DATA_PATH" = "x" ; then
+if test "${FREECIV_DATA_PATH}" = "" ; then
   FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@"
 fi
 FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data"
 export FREECIV_DATA_PATH
 
-if test "x$FREECIV_SAVE_PATH" = "x" ; then
+if test "${FREECIV_SAVE_PATH}" = "" ; then
   FREECIV_SAVE_PATH=".@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@saves"
 fi
 FREECIV_SAVE_PATH="${FREECIV_SAVE_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_PATH_SEPARATOR@@top_srcdir@"
 export FREECIV_SAVE_PATH
 
-if test "x$FREECIV_SCENARIO_PATH" = "x" ; then
+if test "${FREECIV_SCENARIO_PATH}" = "" ; then
   FREECIV_SCENARIO_PATH=".@HOST_PATH_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@scenarios"
 fi
 FREECIV_SCENARIO_PATH="${FREECIV_SCENARIO_PATH}@HOST_PATH_SEPARATOR@@top_builddir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@top_srcdir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios"
 export FREECIV_SCENARIO_PATH
 
-[ -x $BUILDDIR/server/$EXENAME ] && EXE=$BUILDDIR/server/$EXENAME
-[ -x $BUILDDIR/$EXENAME ] && EXE=$BUILDDIR/$EXENAME
+[ -x "${BUILDDIR}/server/${EXENAME}" ] && EXE="${BUILDDIR}/server/${EXENAME}"
+[ -x "${BUILDDIR}/${EXENAME}" ] && EXE="${BUILDDIR}/${EXENAME}"
 
-if [ "$EXE" = "" ]; then
-  echo $0: Unable to find $EXENAME.
+if [ "${EXE}" = "" ]; then
+  echo $0: Unable to find ${EXENAME}.
   exit 1
 fi
 
-exec $EXE ${1+"$@"}
+exec "${EXE}" ${1+"$@"}
-- 
2.47.2

