ul(1) holds a static buffer of 512 characters and truncates any line longer than that.
The attached patch allows expanding the buffer to accommodate lines longer than 512 characters. This is only done on the first occurrence of such a line, so for most files no dynamic allocation is needed.