Read the plist from stdin without an explicit -

xxd reads standard input when given no file operand, so the - is
redundant. It also breaks builds that provide xxd through a partial
reimplementation such as OpenWrt's scripts/xxdi.pl, which treats - as a
file name and exits with

  xxdi.pl: Unable to open -: No such file or directory

xml_plist_codegen.sh does not check for that failure, so the generated
plists/get_info_response.c ends up with an empty byte array and AirPlay 2
answers GET /info with nothing.
This commit is contained in:
Kel Modderman
2026-08-09 18:27:20 +10:00
parent 9960f9c482
commit 214eba2e7a
+1 -1
View File
@@ -23,6 +23,6 @@ printf "// Please do not edit this file!\n" > $2/$BASE_FILENAME.c
printf "// This file was automatically generated from $INPUT_FILE_NAME.\n\n" >> $2/$BASE_FILENAME.c printf "// This file was automatically generated from $INPUT_FILE_NAME.\n\n" >> $2/$BASE_FILENAME.c
printf "#include \"$BASE_FILENAME.h\"\n\n" >> $2/$BASE_FILENAME.c printf "#include \"$BASE_FILENAME.h\"\n\n" >> $2/$BASE_FILENAME.c
printf "unsigned char ${BASE_FILENAME}_plist[] = {\n" >> $2/$BASE_FILENAME.c printf "unsigned char ${BASE_FILENAME}_plist[] = {\n" >> $2/$BASE_FILENAME.c
plistutil -i $1 | xxd -i - >> $2/$BASE_FILENAME.c plistutil -i $1 | xxd -i >> $2/$BASE_FILENAME.c
printf " };\n\n" >> $2/$BASE_FILENAME.c printf " };\n\n" >> $2/$BASE_FILENAME.c
printf "size_t ${BASE_FILENAME}_plist_len = sizeof(${BASE_FILENAME}_plist);\n" >> $2/$BASE_FILENAME.c printf "size_t ${BASE_FILENAME}_plist_len = sizeof(${BASE_FILENAME}_plist);\n" >> $2/$BASE_FILENAME.c