Image/Locator: empty strings should produce void locators
No reason to try and load files with empty names.
This commit is contained in:
parent
38cdb2a00c
commit
434f5275ac
1 changed files with 3 additions and 2 deletions
|
@ -239,8 +239,7 @@ std::ostream& operator<<(std::ostream& s, const locator& l)
|
|||
}
|
||||
|
||||
locator::locator(const std::string& fn)
|
||||
: type_(FILE)
|
||||
, filename_(fn)
|
||||
: filename_(fn)
|
||||
{
|
||||
if(filename_.empty()) {
|
||||
return;
|
||||
|
@ -260,6 +259,8 @@ locator::locator(const std::string& fn)
|
|||
type_ = SUB_FILE;
|
||||
modifications_ = filename_.substr(markup_field, filename_.size() - markup_field);
|
||||
filename_ = filename_.substr(0, markup_field);
|
||||
} else {
|
||||
type_ = FILE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue