mirror of
https://github.com/openharmony/developtools_bytrace_standard.git
synced 2026-07-19 15:03:32 -04:00
!36 fix bytrace Infinite loop issue
Merge pull request !36 from wenlong_12/master
This commit is contained in:
+9
-3
@@ -177,9 +177,15 @@ static string CanonicalizeSpecPath(const char* src)
|
||||
return "";
|
||||
}
|
||||
#else
|
||||
if (realpath(src, resolvedPath) == nullptr) {
|
||||
fprintf(stderr, "Error: _fullpath %s failed", src);
|
||||
return "";
|
||||
if (access(src, F_OK) == 0) {
|
||||
if (realpath(src, resolvedPath) == nullptr) {
|
||||
fprintf(stderr, "Error: _fullpath %s failed", src);
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
if (sprintf_s(resolvedPath, PATH_MAX, "%s", src) == -1) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
string res(resolvedPath);
|
||||
|
||||
@@ -283,7 +283,7 @@ MyTrace GetTraceResult(const string& checkContent, const vector<string>& list)
|
||||
regex pattern(checkContent);
|
||||
smatch match;
|
||||
Param param {""};
|
||||
for (unsigned int i = list.size() - 1; i >= 0; i--) {
|
||||
for (int i = list.size() - 1; i >= 0; i--) {
|
||||
if (regex_match(list[i], match, pattern)) {
|
||||
param.m_task = match[TASK];
|
||||
param.m_tid = match[TID];
|
||||
|
||||
Reference in New Issue
Block a user