From f7e36b4de4387f8662dbb88b550915a021e8f99b Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Sat, 8 Aug 2009 16:05:08 +0800 Subject: [PATCH] core:PXELINUX: fix the OACK option parsing bug. the current code can just handle one option beacuse I put the do-while loop in the wrong position. --- core/pxe.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pxe.c b/core/pxe.c index 81d3e23..bda1a54 100644 --- a/core/pxe.c +++ b/core/pxe.c @@ -928,20 +928,20 @@ static void pxe_searchdir(char *filename, struct file *file) if (*options == 0) goto done; - dst = src = options; - while (buffersize--) { - if (*src == 0) - break; /* found a final null */ - *dst++ = *src++ | 0x20; - if (!buffersize) - goto done; /* found no final null */ - } - - /* - * Parse option pointed to by options; guaranteed to be null-terminated - */ - p = options; do { + dst = src = options; + while (buffersize--) { + if (*src == 0) + break; /* found a final null */ + *dst++ = *src++ | 0x20; + if (!buffersize) + goto done; /* found no final null */ + } + + /* + * Parse option pointed to by options; guaranteed to be null-terminated + */ + p = options; tftp_opt = tftp_options; for (i = 0; i < tftp_opts; i++) { if (!strncmp(p, tftp_opt->str_ptr,tftp_opt->str_len)) -- 2.7.4