forked from OSchip/llvm-project
clang-format: Don't allow -i when reading from stdin.
llvm-svn: 236592
This commit is contained in:
parent
20e0af6b62
commit
fc510b67fe
|
@ -247,7 +247,9 @@ static bool format(StringRef FileName) {
|
|||
Rewriter Rewrite(Sources, LangOptions());
|
||||
tooling::applyAllReplacements(Replaces, Rewrite);
|
||||
if (Inplace) {
|
||||
if (Rewrite.overwriteChangedFiles())
|
||||
if (FileName == "-")
|
||||
llvm::errs() << "error: cannot use -i when reading from stdin.\n";
|
||||
else if (Rewrite.overwriteChangedFiles())
|
||||
return true;
|
||||
} else {
|
||||
if (Cursor.getNumOccurrences() != 0)
|
||||
|
|
Loading…
Reference in New Issue