|
|
@@ -5,6 +5,7 @@
|
|
|
#include "cmDependsJavaLexer.h"
|
|
|
#include "cmSystemTools.h"
|
|
|
|
|
|
+#include "cm_string_view.hxx"
|
|
|
#include "cmsys/FStream.hxx"
|
|
|
#include <iostream>
|
|
|
#include <stdio.h>
|
|
|
@@ -298,14 +299,10 @@ void cmDependsJavaParserHelper::Error(const char* str)
|
|
|
unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
|
|
|
fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", str, pos,
|
|
|
this->CurrentLine);
|
|
|
- int cc;
|
|
|
- std::cerr << "String: [";
|
|
|
- for (cc = 0;
|
|
|
- cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
|
|
|
- cc++) {
|
|
|
- std::cerr << *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
|
|
|
- }
|
|
|
- std::cerr << "]" << std::endl;
|
|
|
+ std::cerr << "String: ["
|
|
|
+ << cm::string_view{ this->InputBuffer }.substr(
|
|
|
+ this->InputBufferPos, 30)
|
|
|
+ << "]" << std::endl;
|
|
|
}
|
|
|
|
|
|
void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
|