[sword-cvs] sword/src/utilfuns url.cpp,1.7,1.8
sword at www.crosswire.org
sword at www.crosswire.org
Tue Jul 20 12:06:43 MST 2004
Committed by: scribe
Update of /cvs/core/sword/src/utilfuns
In directory www:/tmp/cvs-serv29924/src/utilfuns
Modified Files:
url.cpp
Log Message:
Debugging why this doesn't work:
http://www.crosswire.org?arg=val&yo=we&stuff=bla
but this does:
http://www.crosswire.org/yo.jsp?arg=val&yo=we&stuff=bla
Index: url.cpp
===================================================================
RCS file: /cvs/core/sword/src/utilfuns/url.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- url.cpp 20 Jul 2004 11:24:53 -0000 1.7
+++ url.cpp 20 Jul 2004 19:06:41 -0000 1.8
@@ -66,11 +66,18 @@
* Returns the value of an URL parameter. For the URL "http://www.crosswire.org/index.jsp?page=test&user=nobody" the value of the parameter "page" would be "test".
* If the parameter is not set an empty string is returned.
*/
-const char* URL::getParamterValue(const char* name) const {
- ParameterMap::const_iterator it = parameterMap.find(name);
-
+const char* URL::getParameterValue(const char* name) const {
static SWBuf emptyStr("");
- return (it != parameterMap.end()) ? it->second.c_str() : emptyStr.c_str();
+
+ ParameterMap::const_iterator it = parameterMap.find(name);
+ static SWBuf retVal;
+
+ if (it != parameterMap.end())
+ retVal = it->second.c_str();
+ else
+ retVal = emptyStr.c_str();
+
+ return retVal.c_str();
}
More information about the sword-cvs
mailing list