ifup: make /etc/network/interfaces parser tolerant to trailing spaces
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
944d275175
commit
2ace0ad2d7
@ -644,6 +644,9 @@ static const struct address_family_t addr_inet = {
|
|||||||
|
|
||||||
#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
|
#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
|
||||||
|
|
||||||
|
/* Returns pointer to the next word, or NULL.
|
||||||
|
* In 1st case, advances *buf to the word after this one.
|
||||||
|
*/
|
||||||
static char *next_word(char **buf)
|
static char *next_word(char **buf)
|
||||||
{
|
{
|
||||||
unsigned length;
|
unsigned length;
|
||||||
@ -663,7 +666,7 @@ static char *next_word(char **buf)
|
|||||||
if (word[length] != '\0')
|
if (word[length] != '\0')
|
||||||
word[length++] = '\0';
|
word[length++] = '\0';
|
||||||
|
|
||||||
*buf = word + length;
|
*buf = skip_whitespace(word + length);
|
||||||
|
|
||||||
return word;
|
return word;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user