[libvirt-php][PATCH 6/7] generate-api-docs: Adapt to new comments style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]