On 1 April 2010 20:40, Connor Lane Smith <c...@lubutu.com> wrote: > The last dmenu revision doesn't make any sense. It goes through a load > of hassle and complexity dynamically reallocating memory, and then has > no real effect, because text is a fixed 4096 byte buffer. Items longer > than 4096 chars are just plain inaccessible. > > There are two options here. Either at the end of readstdin we can > "text = malloc(max)", and then pass around "max" instead of just using > "sizeof text" (since pointers don't work in the same way as arrays)... > which seems ugly to me... Or we can just use a 4096 byte buf in > readstdin, which makes a lot of sense anyway. > > I've been working on a patch since before the recent commits anyway, > so I've merged in the ^A and ^E keybindings, but just increased the > size of the readstdin buf to sizeof text. If we *really* want dynamic > allocation and to pass around a "max" value etc, I suppose I could > merge that in instead, but I don't see the necessity: do we honestly > need to add such complexity in order to support lines longer than > 4096? Those are pretty epic line lengths for what is essentially a > menu. > > So the following patch fixes some bugs and oddities separate to the > whole dynamic alloc issue, as well as just increasing buf to sizeof > text, basically doing the same job as the previous revision.
Forgot to mention I reviewed and applied your patch and added you to the LICENSE file as well. Cheers, Anselm