From dcd535eeb3ceaa9cfb19395f8e1780609f7c7d4b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 3 May 2005 16:21:16 +0000 Subject: [PATCH] Reliable result for connection::option() when returning a null value. --- zoom/zconn.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zoom/zconn.cpp b/zoom/zconn.cpp index 3b3137a..4c1c7a6 100644 --- a/zoom/zconn.cpp +++ b/zoom/zconn.cpp @@ -1,4 +1,4 @@ -// $Header: /home/cvsroot/yaz++/zoom/zconn.cpp,v 1.6 2003-09-22 12:25:20 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zconn.cpp,v 1.7 2005-05-03 16:21:16 mike Exp $ // Z39.50 Connection class @@ -23,7 +23,8 @@ namespace ZOOM { } std::string connection::option(const std::string &key) const { - return ZOOM_connection_option_get(c, key.c_str()); + const char* val = ZOOM_connection_option_get(c, key.c_str()); + return (val) ? val : std::string(); } bool connection::option(const std::string &key, const std::string &val) { -- 1.7.10.4