diff options
author | elfmz <fenix1905@tut.by> | 2022-11-13 02:02:17 +0300 |
---|---|---|
committer | elfmz <fenix1905@tut.by> | 2022-11-13 02:02:17 +0300 |
commit | 4a0860df71235d95c9a04a78e24bc77accbadcb5 (patch) | |
tree | c244aab4c6c205c3e8026515d7a3288719438088 /far2l/src/message.cpp | |
parent | 1bbd76a8d7f2828c02c058f0b360f8e38e411323 (diff) |
Diffstat (limited to 'far2l/src/message.cpp')
-rw-r--r-- | far2l/src/message.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/far2l/src/message.cpp b/far2l/src/message.cpp index e2e273dc..3072e5d6 100644 --- a/far2l/src/message.cpp +++ b/far2l/src/message.cpp @@ -566,9 +566,16 @@ void GetMessagePosition(int &X1,int &Y1,int &X2,int &Y2) Y2=MessageY2; } +static FARString s_ErrorString; + bool GetErrorString(FARString &strErrStr) { auto err = errno; + if (err == -1 && !s_ErrorString.IsEmpty()) { + strErrStr = s_ErrorString; + return true; + } + const char *str = strerror(err); if (str) { strErrStr.Format(L"%s (%u)", str, err); @@ -578,6 +585,11 @@ bool GetErrorString(FARString &strErrStr) return true; } +void SetErrorString(const FARString &strErrStr) +{ + s_ErrorString = strErrStr; + errno = -1; +} void SetMessageHelp(const wchar_t *Topic) { |