aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-16 23:56:10 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-16 23:56:10 +0200
commit2ace0ad2d7ee52e44dc98feb77bedf5e866e8f11 (patch)
tree13d29c84341438f5d756a87e52b624658c1c8ac7
parent944d275175bd712d7a97241c762acc9e3bcd8a2a (diff)
downloadbusybox-w32-2ace0ad2d7ee52e44dc98feb77bedf5e866e8f11.tar.gz
busybox-w32-2ace0ad2d7ee52e44dc98feb77bedf5e866e8f11.tar.bz2
busybox-w32-2ace0ad2d7ee52e44dc98feb77bedf5e866e8f11.zip
ifup: make /etc/network/interfaces parser tolerant to trailing spaces
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ifupdown.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 6b9449213..d0c5cce07 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -644,6 +644,9 @@ static const struct address_family_t addr_inet = {
644 644
645#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */ 645#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
646 646
647/* Returns pointer to the next word, or NULL.
648 * In 1st case, advances *buf to the word after this one.
649 */
647static char *next_word(char **buf) 650static char *next_word(char **buf)
648{ 651{
649 unsigned length; 652 unsigned length;
@@ -663,7 +666,7 @@ static char *next_word(char **buf)
663 if (word[length] != '\0') 666 if (word[length] != '\0')
664 word[length++] = '\0'; 667 word[length++] = '\0';
665 668
666 *buf = word + length; 669 *buf = skip_whitespace(word + length);
667 670
668 return word; 671 return word;
669} 672}