use XMLLING_INDENT environment variable to control indentation for the xmllint "--format" option
diff --git a/ChangeLog b/ChangeLog
index 329b90e..e44027a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Mar 9 13:53:16 2003 Aleksey Sanin <aleksey@aleksey.com>
+
+ * xmllint.c doc/xmllint.xml: use $XMLLINT_INDENT environment
+ variable to control the indentation for the xmllint "--format"
+ option
+
Sat Mar 8 14:27:43 CET 2003 Igor Zlatkovic <igor@zlatkovic.com>
* encoding.c: applied Gennady's patch against buffer overrun
diff --git a/doc/xmllint.xml b/doc/xmllint.xml
index 9bfbf64..356e456 100644
--- a/doc/xmllint.xml
+++ b/doc/xmllint.xml
@@ -330,7 +330,9 @@
<term><option>--format</option></term>
<listitem>
<simpara>
- Reformat and reindent the output.
+ Reformat and reindent the output. The $XMLLINT_INDENT
+ environment variable controls the indentation (default
+ value is two spaces " ").
</simpara>
</listitem>
</varlistentry>
diff --git a/xmllint.c b/xmllint.c
index a88de5b..29f368b 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -1247,7 +1247,8 @@
int i, acount;
int files = 0;
int version = 0;
-
+ const char* indent;
+
if (argc <= 1) {
usage(argv[0]);
return(1);
@@ -1452,6 +1453,12 @@
xmlRegisterNodeDefault(registerNode);
xmlDeregisterNodeDefault(deregisterNode);
}
+
+ indent = getenv("XMLLINT_INDENT");
+ if(indent != NULL) {
+ xmlTreeIndentString = indent;
+ }
+
xmlLineNumbersDefault(1);
if (loaddtd != 0)