Bug
- Disallowed @ and / from an attribute name or modifier. This causes input like 'user@host:path' to now be parsed as description, and not as an unrecognized attribute.
This commit is contained in:
18
src/Att.cpp
18
src/Att.cpp
@@ -205,14 +205,18 @@ bool Att::valid (const std::string& input) const
|
||||
if (!n.getUntilOneOf (".:", ignored))
|
||||
return false;
|
||||
|
||||
if (n.skip (':') &&
|
||||
(n.getQuoted ('"', ignored) ||
|
||||
n.getUntil (' ', ignored) ||
|
||||
n.getUntilEOS (ignored) ||
|
||||
n.depleted ()))
|
||||
return true;
|
||||
if (n.skip (':'))
|
||||
{
|
||||
if (input.find ('@') <= n.cursor () ||
|
||||
input.find ('/') <= n.cursor ())
|
||||
return false;
|
||||
|
||||
return false;
|
||||
if (n.getQuoted ('"', ignored) ||
|
||||
n.getUntil (' ', ignored) ||
|
||||
n.getUntilEOS (ignored) ||
|
||||
n.depleted ())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -552,6 +552,12 @@ char Nibbler::next ()
|
||||
return '\0';
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string::size_type Nibbler::cursor ()
|
||||
{
|
||||
return mCursor;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Peeks ahead - does not move cursor.
|
||||
std::string Nibbler::next (const int quantity)
|
||||
|
||||
@@ -69,6 +69,8 @@ public:
|
||||
char next ();
|
||||
std::string next (const int quantity);
|
||||
|
||||
std::string::size_type cursor ();
|
||||
|
||||
void save ();
|
||||
void restore ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user