Bug with apostrophe in displayed text in pupdialog

Moderator: BarryK

Post Reply
Caramel
Posts: 490
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 102 times
Been thanked: 84 times

Bug with apostrophe in displayed text in pupdialog

Post by Caramel »

(EasyOS 5.7)

There is a problem when the character ' appears in the text displayed by pupdialog.

Line 126 of /usr/bin/pupdialog

Code: Select all

eval "${AVAR}='${AVAL}'" 

AVAR is a variable that contains the name of another variable (AVAR is modified during the script execution, it represents several variables at different times)
AVAL is a variable with text to be displayed.
The line is a assignation of the value of AVAL to the variable $AVAR (not to AVAR but to the variable that is the value of AVAR)

This eval command fails if there is an apostrophe (') in the text contained in AVAL.

This code (inspired by https://www.baeldung.com/linux/bash-safe-use-eval) seems to work

Code: Select all

eval ${AVAR}=\"${AVAL}\"

PS : This problem is encountered in the French text of the ROX-app Trash with "Confirmer l'action"

Post Reply

Return to “EasyOS”