From 6301912ae84498e8ff6d1895da86f1c854893dae Mon Sep 17 00:00:00 2001
From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl>
Date: Mon, 14 Feb 2011 11:36:15 +0100
Subject: [PATCH] wcclrules fix stdin/files

---
 wcclrules/main.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wcclrules/main.cpp b/wcclrules/main.cpp
index 40936af..7b83fe0 100644
--- a/wcclrules/main.cpp
+++ b/wcclrules/main.cpp
@@ -163,12 +163,14 @@ int main(int argc, char** argv)
 	foreach (const std::string& f, files) {
 		if (boost::algorithm::ends_with(f, ".xml")) {
 			corpora_files.push_back(f);
-			corpus_stdin = false;
 		} else {
 			ccl_files.push_back(f);
 		}
 	}
 
+    // consider stdin only when no corpus files given
+    corpus_stdin = corpus_stdin && corpora_files.empty();
+
 	try {
 		const Corpus2::Tagset& tagset = Corpus2::get_named_tagset(tagset_load);
 		Wccl::Parser parser(tagset);
-- 
GitLab