diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 34b0c794a..bc0ec2411 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2015-11-06 Jon Turney + + * doc/makedoc.c (iscommand): Only allow commands to have trailing + spaces, not space separated words. + 2015-11-06 Jon Turney * libm/mathfp/s_acos.c: Fix QUICKREF. diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c index 718864294..96362f782 100644 --- a/newlib/doc/makedoc.c +++ b/newlib/doc/makedoc.c @@ -777,14 +777,18 @@ DEFUN( iscommand,(ptr, idx), unsigned int idx) { unsigned int len = 0; - while (at(ptr,idx)) { - if (isupper(at(ptr,idx)) || at(ptr,idx) == ' ' || - at(ptr,idx) == '_') - { + + while (isupper(at(ptr,idx)) || at(ptr,idx) == '_') { len++; idx++; - } - else if(at(ptr,idx) == '\n') + } + + while (at(ptr,idx) == ' ') { + len++; + idx++; + } + + if(at(ptr,idx) == '\n') { /* The length check will never fail on a real command * because the commands are screened as the definitions file @@ -792,8 +796,7 @@ DEFUN( iscommand,(ptr, idx), if (len >= MIN_CMDLEN) return 1; return 0; } - else return 0; - } + return 0; }