diff --git a/ChangeLog b/ChangeLog index 329b90e1..e44027a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Mar 9 13:53:16 2003 Aleksey Sanin + + * 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 * encoding.c: applied Gennady's patch against buffer overrun diff --git a/doc/xmllint.xml b/doc/xmllint.xml index 9bfbf64d..356e456a 100644 --- a/doc/xmllint.xml +++ b/doc/xmllint.xml @@ -330,7 +330,9 @@ - Reformat and reindent the output. + Reformat and reindent the output. The $XMLLINT_INDENT + environment variable controls the indentation (default + value is two spaces "  "). diff --git a/xmllint.c b/xmllint.c index a88de5b7..29f368b5 100644 --- a/xmllint.c +++ b/xmllint.c @@ -1247,7 +1247,8 @@ main(int argc, char **argv) { int i, acount; int files = 0; int version = 0; - + const char* indent; + if (argc <= 1) { usage(argv[0]); return(1); @@ -1452,6 +1453,12 @@ main(int argc, char **argv) { xmlRegisterNodeDefault(registerNode); xmlDeregisterNodeDefault(deregisterNode); } + + indent = getenv("XMLLINT_INDENT"); + if(indent != NULL) { + xmlTreeIndentString = indent; + } + xmlLineNumbersDefault(1); if (loaddtd != 0)