mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
fixed segfault with incomplete WM_CLASS
This commit is contained in:
@@ -34,6 +34,7 @@ Changes since version 0.80.0:
|
||||
- Window Maker will now use the WINDOWMAKER_ALT_WM environment variable (if
|
||||
it is defined) to overwrite the default hardcoded fallback window manager.
|
||||
- Added Czech translations of documentation (Jiri Hnidek <Jiri.Hnidek@vslib.cz>)
|
||||
- Fixed segfault with incomplete WM_CLASS specifications.
|
||||
|
||||
Changes since version 0.70.0:
|
||||
.............................
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"#pkgdatadir#/Pixmaps",
|
||||
"/usr/X11R6/include/X11/pixmaps",
|
||||
"~/GNUstep/Library/WindowMaker/Pixmaps",
|
||||
"/usr/share/icons",
|
||||
"/usr/local/share/pixmaps",
|
||||
"/usr/share/pixmaps"
|
||||
);
|
||||
|
||||
21
configure.ac
21
configure.ac
@@ -100,7 +100,15 @@ dnl not used anywhere
|
||||
dnl AC_FUNC_MEMCMP
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_ALLOCA
|
||||
<<<<<<< configure.ac
|
||||
<<<<<<< configure.ac
|
||||
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo vsnprintf)
|
||||
=======
|
||||
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo snprintf vsnprintf asprintf vasprintf mkstemp)
|
||||
>>>>>>> 1.4
|
||||
=======
|
||||
AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo mkstemp snprintf vsnprintf asprintf vasprintf)
|
||||
>>>>>>> 1.15
|
||||
|
||||
|
||||
dnl ripped from samba
|
||||
@@ -175,9 +183,22 @@ AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
|
||||
|
||||
dnl Checks for header files.
|
||||
dnl =======================
|
||||
<<<<<<< configure.ac
|
||||
AC_HEADER_STDC
|
||||
=======
|
||||
>>>>>>> 1.4
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_HEADER_TIME
|
||||
<<<<<<< configure.ac
|
||||
<<<<<<< configure.ac
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
|
||||
libintl.h sys/select.h poll.h malloc.h stdlib.h)
|
||||
=======
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h poll.h malloc.h ctype.h stdlib.h string.h strings.h)
|
||||
>>>>>>> 1.4
|
||||
=======
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h poll.h malloc.h ctype.h string.h strings.h)
|
||||
>>>>>>> 1.15
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -93,12 +93,15 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next);
|
||||
char *MakeCPPArgs(char *path);
|
||||
#endif
|
||||
|
||||
char *StrConcatDot(char *a, char *b);
|
||||
|
||||
char *ExpandOptions(WScreen *scr, char *cmdline);
|
||||
|
||||
void ExecuteShellCommand(WScreen *scr, char *command);
|
||||
|
||||
void StartLogShell(WScreen *scr);
|
||||
|
||||
|
||||
Bool IsDoubleClick(WScreen *scr, XEvent *event);
|
||||
|
||||
WWindow *NextToFocusAfter(WWindow *wwin);
|
||||
|
||||
19
src/misc.c
19
src/misc.c
@@ -1271,3 +1271,22 @@ UpdateDomainFile(WDDomain *domain)
|
||||
}
|
||||
|
||||
|
||||
|
||||
char*
|
||||
StrConcatDot(char *a, char *b)
|
||||
{
|
||||
int len;
|
||||
char *str;
|
||||
|
||||
if (!a)
|
||||
a = "";
|
||||
if (!b)
|
||||
b = "";
|
||||
|
||||
len = strlen(a)+strlen(b)+4;
|
||||
str = wmalloc(len);
|
||||
|
||||
snprintf(str, len, "%s.%s", a, b);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -830,9 +830,9 @@ wManageWindow(WScreen *scr, Window window)
|
||||
|
||||
#define ADEQUATE(x) ((x)!=None && (x)!=wwin->client_win && (x)!=fPtr->leader)
|
||||
|
||||
|
||||
PropGetWMClass(wwin->main_window, &class, &instance);
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
buffer = StrConcatDot(instance, class);
|
||||
|
||||
index = WMFindInArray(scr->fakeGroupLeaders, matchIdentifier, (void*)buffer);
|
||||
if (index != WANotFound) {
|
||||
|
||||
@@ -527,8 +527,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
else if (WMGetButtonSelected(panel->bothRb) != 0) {
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+2);
|
||||
sprintf(buffer, "%s.%s", wwin->wm_instance, wwin->wm_class);
|
||||
buffer = StrConcatDot(wwin->wm_instance, wwin->wm_class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
} else if (WMGetButtonSelected(panel->defaultRb) != 0) {
|
||||
@@ -684,8 +683,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
char *class = wapp->main_window_desc->wm_class;
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
buffer = StrConcatDot(instance, class);
|
||||
key2 = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user