Re: [dev] [patch] xmms like pattern matching for dmenu (update to hg tip)

From: StephenB <mail4stb_AT_gmail.com>
Date: Sat, 7 Aug 2010 17:23:13 +0100

On 7 August 2010 14:25, Rob <robpilling_AT_gmail.com> wrote:

> Uh, in tokenise, shouldn't
> strncpy(tmp, pat, strlen(pat));
> be
> strncpy(tmp, pat, sizeof tmp); ?

we only tokenise text, so it can simplify to:
unsigned int
tokenize(char **tok) {
unsigned int i = 0;
char tmp[sizeof text] = {0};

strcpy(tmp, text);

I also corrected the size_t len, tokencnt = 0; mistake (tokencnt wanted to
be an unsigned int).

new patch:
http://pastebin.com/raw.php?i=C82sS3U7

Just to make clear, this patch is an updated version of the one here:
http://tools.suckless.org/dmenu/patches/xmms-like_pattern_matching
Received on Sat Aug 07 2010 - 18:23:13 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 07 2010 - 18:24:02 CEST