Skip to content

Commit

Permalink
Changed log messages. Moved one end of string check to proper place.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jun 20, 2012
1 parent 9ada24c commit ba0d1e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions agent-ini/src/quotes.cc
Expand Up @@ -65,15 +65,17 @@ string parse_dquoted_string( string::const_iterator & sit, const string::const_i
return ret;

case '\\':
if( sit == last)
break;

switch( *(++sit))
{
case '"':
case '\\':
case '`':
case '$':
case '\n':
if( sit != last)
ret += *(sit++);
ret += *(sit++);
break;

default:
Expand All @@ -88,7 +90,7 @@ string parse_dquoted_string( string::const_iterator & sit, const string::const_i
}
}

throw invalid_argument( "Missing enclosing dquote.");
throw invalid_argument( "Missing enclosing double quote.");
return "";
}

Expand All @@ -108,7 +110,7 @@ string parse_squoted_string( string::const_iterator & sit, const string::const_i
}
}

throw invalid_argument( "Missing enclosing squote.");
throw invalid_argument( "Missing enclosing single quote.");
return "";
}

Expand Down
2 changes: 1 addition & 1 deletion agent-ini/testsuite/tests/shellquotes.err
@@ -1 +1 @@
[Interpreter] tests/shellquotes.ycp:XXX Unquoting error: Missing enclosing dquote. Unquoted value: <"invalid - unclosed>.
[Interpreter] tests/shellquotes.ycp:XXX Unquoting error: Missing enclosing double quote. Unquoted value: <"invalid - unclosed>.

0 comments on commit ba0d1e9

Please sign in to comment.