]> git.mxchange.org Git - flightgear.git/blobdiff - utils/xmlgrep/xmlgrep.c
Merge branch 'ehofman/version'
[flightgear.git] / utils / xmlgrep / xmlgrep.c
index 98a1077386a51f9471dc736b8b0e64edb661494e..23577b0c8d2415a25343817e413c1dcd33836cf1 100644 (file)
@@ -5,12 +5,13 @@
 #include <string.h>
 #ifndef _MSC_VER
 # include <strings.h>
+# include <unistd.h>   /* read */
 #else
 # define strncasecmp strnicmp
 # include <stdlib.h>
+# include <io.h>
 #endif
 #include <assert.h>
-#include <unistd.h>    /* read */
 #include <sys/stat.h>  /* fstat */
 #include <fcntl.h>     /* open */
 
@@ -217,7 +218,12 @@ void walk_the_tree(size_t num, void *xid, char *tree)
                     value = xmlGetString(xmid);
                     if (_value && _attribute && value)
                     {
+#if 1
+                       char *a = xmlAttributeGetString(xmid, _attribute);
+                       if (a && !strcmp(a, _value))
+#else
                        if (!xmlAttributeCompareString(xmid, _attribute, _value))
+#endif
                        {
                           printf("%s: <%s %s=\"%s\">%s</%s>\n",
                                  _filenames[num], _print, _attribute, _value,