w3m icon indicating copy to clipboard operation
w3m copied to clipboard

Retry if loading of a file fails

Open rkta opened this issue 2 years ago • 1 comments

This fixes GH issue #210, Debian BTS #5377611 and obsoletes Debian BTS #9464402.

File names like 'a#a.html', 'b?b.html' or 'c%20.html' can not be opened without using '-o argv_is_url=1' as the file name is interpreted as a local URL.

If everything fails and argv_is_url is not set retry as a local file.

rkta avatar May 26 '22 09:05 rkta

On Thu, May 26, 2022 at 03:40:49PM -0700, N-R-K wrote:

@N-R-K commented on this pull request.

    if (getURLScheme(&url) == SCM_MISSING && !ArgvIsURL)
  • retry_as_local_file: url = file_to_url(load_argv[i]); else

Style nit: I'd put braces around it. Or maybe something like the following: General style is to not use braces if a single statement will do. Having a label after the 'if' is a special case which is not present in the current code base. I'll follow the majority here.

	  retry_as_local_file:
	    if (retry || (getURLScheme(&url) == SCM_MISSING && !ArgvIsURL))
		url = file_to_url(load_argv[i]);
	    else

I don't like this suggestion. Checking the condition after jumping to the label is redundant. We'll only jump to the label after checking the condition.

rkta avatar May 29 '22 09:05 rkta

Merged, thanks for your contribution.

tats avatar Dec 25 '22 01:12 tats