[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49228] imread should only read from a URL if

From: Rik
Subject: [Octave-bug-tracker] [bug #49228] imread should only read from a URL if name looks like a URL, only read from a local file otherwise
Date: Wed, 16 Nov 2016 19:26:29 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #6, bug #49228 (project octave):

This seems easy enough to fix with a regular expression.  The question is what
should the regexp be?

According to https://en.wikipedia.org/wiki/URI_scheme, the most basic form is


The double forward slash is required by some schemes and not by others, so it
can't necessary be used in the regexp.

Because we operate on Windows now, we also have to avoid interping a drive
letter specification as a URI scheme.  For example,


which is definitely a path on the local machine.  After checking with
Microsoft itself
 It seems that a drive letter is always a single character.

A possible regexp for testing is

is_url = ! isempty (regexp (fname, '^[a-zA-Z][a-zA-Z0-9.+-]+:'));


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]