From cf9f2523045a40a68b14a4d8544614037f85a28b Mon Sep 17 00:00:00 2001
From: Tinny Ng <tng@apache.org>
Date: Mon, 19 Aug 2002 14:40:31 +0000
Subject: [PATCH] Fix: public id / system id in entity decl should be null if
 empty

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174143 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/validators/DTD/DTDScanner.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xercesc/validators/DTD/DTDScanner.cpp b/src/xercesc/validators/DTD/DTDScanner.cpp
index 24e75beb8..4c599562a 100644
--- a/src/xercesc/validators/DTD/DTDScanner.cpp
+++ b/src/xercesc/validators/DTD/DTDScanner.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.9  2002/08/19 14:40:31  tng
+ * Fix: public id / system id in entity decl should be null if empty
+ *
  * Revision 1.8  2002/07/26 13:33:44  knoaman
  * Public/System id for notations should be stored as NULL if missing.
  *
@@ -2262,8 +2265,10 @@ bool DTDScanner::scanEntityDef(DTDEntityDecl& decl, const bool isPEDecl)
         return false;
 
     // Fill in the id fields of the decl with the info we got
-    decl.setPublicId(bbPubId.getRawBuffer());
-    decl.setSystemId(bbSysId.getRawBuffer());
+    const XMLCh* publicId = bbPubId.getRawBuffer();
+    const XMLCh* systemId = bbSysId.getRawBuffer();        
+    decl.setPublicId((*publicId) ? publicId : 0);
+    decl.setSystemId((*systemId) ? systemId : 0);
 
     // If its a PE decl, we are done
     bool gotSpaces = checkForPERef(false, false, true);
-- 
GitLab