Skip to content

Commit 499e813

Browse files
viviermcayland
authored andcommitted
toke: fix line parsing on big-endian
Trying to compile openbios on Fedora 22 ppc64, I had the following error: toke -o QEMU,VGA.bin ~/openbios/drivers/vga.fs ... Tokenizing ~/openbios/drivers/vga.fs Binary output to QEMU,VGA.bin Warning: File ~/openbios/drivers/vga.fs, Line 1. Unterminated comment Nothing Tokenized. 1 Warning. This can be reproduced with the fcode-utils examples. "toke" is parsing the comment line until it finds a '\n'. The '\n' is stored as a char in a field of an union, but it is read as a long. It works well on little endian but not on big endian. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/fcode-utils-devel@1354 f158a5a8-5612-0410-a976-696ce0be7e32
1 parent 40a02e5 commit 499e813

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

toke/scanner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ static void handle_user_message( char delim, bool print_it )
16251625

16261626
void user_message( tic_param_t pfield )
16271627
{
1628-
char delim = (char)pfield.deflt_elem ;
1628+
char delim = (char)pfield.fw_token ;
16291629
handle_user_message( delim, TRUE);
16301630
}
16311631

@@ -5295,7 +5295,7 @@ void skip_string( tic_param_t pfield)
52955295

52965296
void process_remark( tic_param_t pfield )
52975297
{
5298-
char until_char = (char)pfield.deflt_elem ;
5298+
char until_char = (char)pfield.fw_token ;
52995299
unsigned int start_lineno = lineno;
53005300

53015301
#ifdef DEBUG_SCANNER

0 commit comments

Comments
 (0)