* SessionNewModule_GETTEXT() was expecting a StrBuf but getting a OneHTTPHeader,...
authorArt Cancro <ajc@citadel.org>
Thu, 11 Jun 2009 21:31:16 +0000 (21:31 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 11 Jun 2009 21:31:16 +0000 (21:31 +0000)
webcit/gettext.c

index 501132188aee9f369e8443522861c6e7e577fb11..12a1bc99d5eada96ece2870d9bffd8ec2d4d67da 100644 (file)
@@ -61,7 +61,7 @@ void httplang_to_locale(StrBuf *LocaleString, wcsession *sess)
        int nParts;
        StrBuf *Buf = NULL;
        StrBuf *SBuf = NULL;
-       
+
        nParts=StrBufNum_tokens(LocaleString,',');
        for (i=0; ((i<nParts)&&(i<SEARCH_LANG)); i++)
         {
@@ -395,12 +395,14 @@ SessionNewModule_GETTEXT
 (wcsession *sess)
 {
 #ifdef ENABLE_NLS
-       void *vLine;
-       ////TODO: make me a header getter
-       if ((sess->Hdr->HTTPHeaders!= NULL) &&
-           GetHash(sess->Hdr->HTTPHeaders, HKEY("ACCEPT-LANGUAGE"), &vLine) && 
-           (vLine != NULL)) {
-               StrBuf *accept_language = (StrBuf*) vLine;
+       OneHttpHeader *vLine = NULL;
+
+       if (    (sess->Hdr->HTTPHeaders != NULL)
+               && GetHash(sess->Hdr->HTTPHeaders, HKEY("ACCEPT-LANGUAGE"), (void *)&vLine)
+               && (vLine != NULL)
+               && (vLine->Val != NULL)
+       ) {
+               StrBuf *accept_language = vLine->Val;
                httplang_to_locale(accept_language, sess);
        }
 #endif