[Pkg-libvirt-commits] [libguestfs] 43/59: inspector: fix formatting of xpath result (RHBZ#1212680)

Hilko Bengen bengen at moszumanska.debian.org
Sun May 3 21:26:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 1f514f3466138b317028d5225ee53fe9cabfb9d7
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Wed Apr 29 14:57:22 2015 +0200

    inspector: fix formatting of xpath result (RHBZ#1212680)
    
    Discard blank nodes when reading the XML from stdin, while enabling
    formatting in output nodes.
---
 inspector/inspector.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/inspector/inspector.c b/inspector/inspector.c
index 1863de0..412384a 100644
--- a/inspector/inspector.c
+++ b/inspector/inspector.c
@@ -769,7 +769,7 @@ do_xpath (const char *query)
   xmlSaveCtxtPtr saveCtx;
   xmlNodePtr wrnode;
 
-  doc = xmlReadFd (STDIN_FILENO, NULL, "utf8", 0);
+  doc = xmlReadFd (STDIN_FILENO, NULL, "utf8", XML_PARSE_NOBLANKS);
   if (doc == NULL) {
     fprintf (stderr, _("%s: unable to parse XML from stdin\n"), guestfs_int_program_name);
     exit (EXIT_FAILURE);
@@ -795,7 +795,7 @@ do_xpath (const char *query)
     if (nodes == NULL)
       break;
 
-    saveCtx = xmlSaveToFd (STDOUT_FILENO, NULL, XML_SAVE_NO_DECL);
+    saveCtx = xmlSaveToFd (STDOUT_FILENO, NULL, XML_SAVE_NO_DECL | XML_SAVE_FORMAT);
     if (saveCtx == NULL) {
       fprintf (stderr, _("%s: xmlSaveToFd failed\n"), guestfs_int_program_name);
       exit (EXIT_FAILURE);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list