return query.ToNewCString();
return ToNewCString(query);
MangleKeywordIntoHTTPURL(const char *aSpec, const char *aHTTPURL) {    char * unescaped = nsCRT::strdup(aSpec);    if(unescaped == nsnull)        return nsnull;    nsUnescape(unescaped);    // build up a request to the keyword server.    nsCAutoString query;    // pull out the "go" action word, or '?', if any    char one = unescaped[0], two = unescaped[1];    if (one == '?') {                            // "?blah"        query = unescaped+1;    } else if ( (one == 'g' || one == 'G')       //                            &&                   //                (two == 'o' || two == 'O')       // "g[G]o[O] blah"                            &&                   //                     (unescaped[2] == ' ') ) {      //        query = unescaped+3;    } else {        query = unescaped;    }    nsMemory::Free(unescaped);    query.Trim(" "); // pull leading/trailing spaces.    // encode    char * encQuery = nsEscape(query.get(), url_Path);    if (!encQuery) return nsnull;    query = encQuery;    nsMemory::Free(encQuery);    // prepend the query with the keyword url    // XXX this url should come from somewhere else    query.Insert(aHTTPURL, 0);    return query.ToNewCString();}