On Monday 08 Aug 2011 09:15:19 Bovey Christian wrote:
> Conclusion: The goto function only work with "Linux" end of line...Maybe
> other people will encounter this problem...
Could you try the attached (completely untested) patch to see if it fixes this
problem for you?
> Second problem, the "echo" function remove some space, so we are not able
> to make some nice menu. Here's the code for the three first lines of the
> screenshot:
> echo
========================================================
> echo | DSI-CHUV - DEMARRAGE PAR LE RESEAU v1.0 - iPXE |
> echo
========================================================
> Has you can see, the second line doesn't show as we want.
The blocks of whitespace are collapsed down as part of the command-line
processing, and there is no quoting mechanism you can use to avoid this. You
can work around this by creating a variable to act as a non-breaking space:
set spc:hex 20
echo |${spc}${spc}${spc}${spc}DSI-CHUV - ...
Michael
diff --git a/src/image/script.c b/src/image/script.c
index 161ac68..fb89e42 100644
--- a/src/image/script.c
+++ b/src/image/script.c
@@ -221,11 +221,17 @@ static const char *goto_label;
* @ret rc Return status code
*/
static int goto_find_label ( const char *line ) {
+ size_t len = strlen ( goto_label );
if ( line[0] != ':' )
return -ENOENT;
- if ( strcmp ( goto_label, &line[1] ) != 0 )
+
+ if ( strncmp ( goto_label, &line[1], len ) != 0 )
+ return -ENOENT;
+
+ if ( line[ 1 + len ] && ! isspace ( line[ 1 + len ] ) )
return -ENOENT;
+
return 0;
}
_______________________________________________
ipxe-devel mailing list
[email protected]
https://lists.ipxe.org/mailman/listinfo/ipxe-devel