File: 0105-Fix_path_handling_bug.patch

package info (click to toggle)
xsd 4.0.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,020 kB
  • sloc: cpp: 133,528; ansic: 13,666; makefile: 7,382; sh: 4,521; xml: 2,580; python: 8
file content (20 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Fix path handling bug
Author: Boris Kolpackov <boris@codesynthesis.com>
Origin: git commit b4c3242a763e0461f454cc29be28c2ab26e4a495
Forwarded: not-needed
Last-Update: 2016-09-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/xsd/examples/cxx/tree/embedded/xsdbin.cxx
===================================================================
--- trunk.orig/xsd/examples/cxx/tree/embedded/xsdbin.cxx
+++ trunk/xsd/examples/cxx/tree/embedded/xsdbin.cxx
@@ -334,7 +334,7 @@ main (int argc, char* argv[])
     //
     string::size_type p (base.rfind ('/')), p1 (base.rfind ('\\'));
 
-    if (p1 != string::npos && p1 > p)
+    if (p1 != string::npos && (p == string::npos || p1 > p))
       p = p1;
 
     if (p != string::npos)