Patch by Demi <m@tfiu.de> to fix Debian bug #621690.
From https://bugs.debian.org/621690:
> wmbiff change path of my mailboxes next nearest.
>
> For example wmbiff change 'gleb' to 'glil' for second and fourth mailboxes.
> However the 1st, 3rd and 5th mailboxes have correct path.
Well, the indices don't really enter. I'm actually surprised this
isn't more trouble.
The underlying reason is that in wmbiff.c:parse_mbox_path, the
program calls
mboxCreate((&mbox[item]), mbox[item].path);
which for maildirs calls
int maildirCreate(Pop3 pc, const char *str)
in maildirClient.c. str in this way is an alias for pc->path.
In maildirCreate, after some char acrobatics, the program eventually
does
strncpy(pc->path, str + 8 + i, BUF_BIG - 1);
to cut off the leading stuff from the maildir. The result of this
operation is not defined, as pc->path and str point to the same
memory and thus the arguments overlap, which strncpy outlaws.
A simple fix is to copy manually, like this:
DM(pc, DEBUG_ERROR, "maildir '%s' is too long.\n", str + 8 + i);
memset(pc->path, 0, BUF_BIG);
} else {
+ const char *sp = str + 8 + i;
+ char *dp = pc->path;
+
+ while (*sp && sp-str<BUF_BIG-1) {
+ *dp++ = *sp++;
+ }
+ *dp = 0;
- strncpy(pc->path, , BUF_BIG - 1); /* cut off ``maildir:'' */
}
-- it's what I'm doing now. But I give you that's a bit pedestrian.
In Window Maker, windows with application class "DockApp" are automatically
withdrawn. We don't want this in windowed mode. We use the application
name instead, with the usual convention of capitalizing the initial letter.
Patch by Corin-EU from GitHub [1].
In libdockapps file wmgeneral.c, wname is set from argv[0] and is then used
to set the window name and class resource. Often applications are called with
their full path which then means that the window name has a path in it,
thereby requiring an unwieldy path specific string for "Name" in WMState if
the applet is to be captured in the WM dock.
The simple solution is that wname should be the basename of argv[0] to
ensure that the window name for the applet is the simple and obvious one.
Thus the inclusion of header file libgen.h is required.
Just say "no" to path slashes "/" in window name/class resources ....
[1] https://github.com/d-torrance/dockapps/issues/5
These are created by NFS clients to help delete files. See:
http://nfs.sourceforge.net/#faq_d2
We don't need this in git.
Reported-by: Nerijus Baliunas <nerijus@users.sourceforge.net>