Skip to content

Commit

Permalink
added a test on the --id option (must be a valid NCName)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ko van der Sloot authored and Ko van der Sloot committed Dec 4, 2018
1 parent 6b88c25 commit a71d8be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Frog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ bool parse_args( TiCC::CL_Options& Opts,
};
options.doXMLout = false;
Opts.extract( "id", options.docid );
if ( !options.docid.empty() ){
if ( !folia::isNCName(options.docid) ){
LOG << "Invalid value for 'id': " << options.docid << " (not a valid NCName)" << endl;
return false;
}
}
if ( Opts.extract( "xmldir", xmlDirName ) ){
if ( xmlDirName.back() != '/' ){
xmlDirName += "/";
Expand Down

0 comments on commit a71d8be

Please sign in to comment.