Previously, it assumed that there's only one star at the
beginning of the comment block and one at the end. The usual C
comment style. Now that I reformatted the comments every line
starts with a star. Update the docs generator to reflect this.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/generate-api-docs.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/generate-api-docs.c b/tools/generate-api-docs.c
index d6e144c..3b88f16 100644
--- a/tools/generate-api-docs.c
+++ b/tools/generate-api-docs.c
@@ -32,10 +32,18 @@ void bail_error(const char *fmt, ...)
char *ltrim_string(char *str)
{
- while (*str++ == ' ') ;
+ /* Skip initial comment indentation */
+ if (strncmp(str, " * ", 3) == 0)
+ str += 3;
+
+ /* Now skip spaces */
+ while (*str == ' ')
+ str++;
+
+ /* TABs are not acceptable! */
if (*str == '\t')
- while (*str++ == '\t')
- if (*str != '\t') break;
+ bail_error("Indent with spaces, not TABs");
+
return str;
}
--
2.3.6