Skip to content

Commit a9d7ebf

Browse files
shmuelieCopilot
andcommitted
msix: fix backslash escaping in map file generation
Using sed with Windows paths in the replacement string causes backslash sequences like \a and \b to be interpreted as special characters, mangling the paths. Use a shell while-read loop instead to avoid escaping issues entirely. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shmueli Englard <senglard@microsoft.com>
1 parent 1dcb21e commit a9d7ebf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

msix/release.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square44x44Logo.scale-200.png\" \"A
192192
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/Square44x44Logo.targetsize-24_altform-unplated.png\" \"Assets/Square44x44Logo.targetsize-24_altform-unplated.png\"" >>"$MAPFILE" &&
193193
echo "\"$(cygpath -aw "$SCRIPT_PATH")/Assets/StoreLogo.png\" \"Assets/StoreLogo.png\"" >>"$MAPFILE" &&
194194
MSYS_ROOT="$(cygpath -aw /)" &&
195-
echo "$LIST" |
196-
sed -e 'y/\//\\/' -e "s|.*|\"$MSYS_ROOT\\\\&\" \"&\"|" >>"$MAPFILE"
195+
echo "$LIST" | while IFS= read -r entry; do
196+
winpath="${entry//\//\\}"
197+
echo "\"$MSYS_ROOT\\$winpath\" \"$winpath\""
198+
done >>"$MAPFILE"
197199

198200
MSYS_NO_PATHCONV=1 "$MAKEAPPX" pack /v /o /f "$(cygpath -aw "$MAPFILE")" /p "$(cygpath -aw "$TARGET")" &&
199201
echo "Package created at $TARGET"

0 commit comments

Comments
 (0)