aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/libldapschema/lformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libldapschema/lformat.c')
-rw-r--r--lib/libldapschema/lformat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libldapschema/lformat.c b/lib/libldapschema/lformat.c
index 6a28645..ee6bf7f 100644
--- a/lib/libldapschema/lformat.c
+++ b/lib/libldapschema/lformat.c
@@ -102,6 +102,7 @@ int ldapschema_fmt_definition( char * restrict str, size_t size, const char * re
102 size_t deflen; 102 size_t deflen;
103 size_t indent; 103 size_t indent;
104 size_t x; 104 size_t x;
105 size_t keylen;
105 char last; 106 char last;
106 107
107 assert(def != NULL); 108 assert(def != NULL);
@@ -156,6 +157,7 @@ int ldapschema_fmt_definition( char * restrict str, size_t size, const char * re
156 157
157 default: 158 default:
158 for(tmppos = defpos; IS_KEYWORD( def[tmppos] ); tmppos++); 159 for(tmppos = defpos; IS_KEYWORD( def[tmppos] ); tmppos++);
160 for(keylen = 0; IS_STRNG(def[keylen+defpos]); keylen++);
159 if ( (tmppos != defpos) && (IS_SPACE(def[tmppos]) || (def[tmppos] == '\0')) ) 161 if ( (tmppos != defpos) && (IS_SPACE(def[tmppos]) || (def[tmppos] == '\0')) )
160 { 162 {
161 // styling for upper case keywords 163 // styling for upper case keywords
@@ -167,7 +169,7 @@ int ldapschema_fmt_definition( char * restrict str, size_t size, const char * re
167 } else 169 } else
168 { 170 {
169 // styling for unquoted strings 171 // styling for unquoted strings
170 if ((strpos - bol) < width) 172 if ((strpos - bol + keylen + 2 + (indent*3)) < width)
171 { 173 {
172 APPEND( ' ' ); 174 APPEND( ' ' );
173 } else 175 } else