1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Fix for dtinfo segfaults

This commit is contained in:
Ulrich Wilkens 2014-02-20 19:48:56 +01:00 committed by Jon Trulson
parent c6038f4b51
commit d0a57b6d57
4 changed files with 9 additions and 12 deletions

View file

@ -141,11 +141,7 @@ IcccmAgent::value_handler(Widget w, XtPointer ia, Atom *selection,
free(wcs);
}
#endif
#if 0
(((IcccmAgent*)ia)->*f_string_handler)((char*)value, *length);
#else
(((IcccmAgent*)f_real_object)->*f_string_handler)((char*)value, *length);
#endif
XtFree((char*)value);
}
else if (*type == XA_COMPOUND_TEXT(XtDisplay(w))) {
@ -168,11 +164,7 @@ IcccmAgent::value_handler(Widget w, XtPointer ia, Atom *selection,
*((char *) memcpy(mbs, string_list[i], len) + len) = '\0';
}
XwcFreeStringList((wchar_t**)string_list);
#if 0
(((IcccmAgent*)ia)->*f_string_handler)(mbs, strlen(mbs));
#else
(((IcccmAgent*)f_real_object)->*f_string_handler)(mbs, strlen(mbs));
#endif
free((void*)mbs);
}
else {

View file

@ -383,7 +383,7 @@ QueryGroup::gen_query_internal (query_type_t query_type)
int
QueryGroup::format (query_type_t query_type, QueryTerm *term)
{
char *s = (char*)"\001s", *tmp;
char *s = strdup("\001s"), *tmp;
// Need two buffers for alternating writes.
// Allocate a buffer with enough room for term plus operators.
static char *buf[2];

View file

@ -620,6 +620,11 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope& scope,
UAS_String msg(CATGETS(Set_DtSR_SearchEngine, 1,
"DtSearch does not support the query."));
DtSearchFreeMessages();
if (current_bc != 0) {
targets.remove(current_bc);
current_bc = NULL;
}
throw(CASTUASEXCEPT UAS_Exception(msg));
continue;
@ -692,10 +697,10 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope& scope,
UAS_Pointer<DtSR_Stems> stems = bookcases[index]->takeover_stems();
UAS_Pointer<UAS_String> q = new UAS_String(oql);
UAS_Pointer<UAS_String> n = new UAS_String(scope.name());
UAS_Pointer<UAS_String> s = new UAS_String(scope.name());
UAS_Pointer<DtSR_SearchResults> DtSR_res =
new DtSR_SearchResults(q, n, res, res->length(),
new DtSR_SearchResults(q, s, res, res->length(),
stems, scope.search_zones(), stype);
if (DtSR_result == (int)0)

View file

@ -1867,7 +1867,7 @@ buildTOC(int argc, char *argv[])
len = MIN(strlen(gStruct->id), MAXPATHLEN);
*((char *) memcpy (idBuf, gStruct->id, len) + len) = '\0';
len = MIN(strlen(gStruct->title), MAXPATHLEN);
*((char *) memcpy (titleBuf, gStruct->id, len) + len) = '\0';
*((char *) memcpy (titleBuf, gStruct->title, len) + len) = '\0';
if (checkStat(gStruct->outFile, FSTAT_IS_FILE))
{