Re: URL_REGEXP and URLs ending with ')'

Dennis Preiser <[email protected]> Sun, 20 Apr 2014 21:30:36 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Sun, Apr 20, 2014 at 01:16:46PM +0200, Martin Klaiber wrote:
> This would be a nice solution. But the main problem is IMHO that it is
> not possible to add characters manually when editing the URL because
> tin seems to limit the length of the URL-string to the original length
> without the ")".

You are right, this is a fixed length and not a dynamic one. It would be
possible to increase the length by a fixed amount. But what would be a
reasonable value: length of the URL + 1 or + 2 or + 5 or + 10 ...

Here is an example with URL + 5:

diff -urp tin-2.2.1_r4/src/page.c tin-2.2.1_r5/src/page.c
--- tin-2.2.1_r4/src/page.c	2014-04-19 21:29:40.000000000 +0200
+++ tin-2.2.1_r5/src/page.c	2014-04-20 16:44:03.000000000 +0200
@@ -2582,7 +2582,7 @@ process_url(
 	t_url *lptr;
 
 	lptr = find_url(n);
-	len = strlen(lptr->url);
+	len = strlen(lptr->url) + 5; /* +5: additional space to allow for completion of truncated url by hand */
 	url = my_malloc(len + 1);
 	if (prompt_default_string("URL:", url, len, lptr->url, HIST_URL)) {
 		if (!*url) {			/* Don't try and open nothing */

The question is, what is less confusing for the user: No additional
input is possible or e.g. only 5 additional characters are possible.

Dennis