[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
[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
Wed, 16 Nov 2016 19:26:29 +0000 (UTC)
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
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
|[Prev in Thread]
||[Next in Thread]|
- [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,