diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/backupfilehelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/windows/windows_process.cxx | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 614789a3bcbc..85d8b2052d44 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -1620,8 +1620,6 @@ namespace bool tryPop(oslFileHandle& rHandle) { - bool bRetval(false); - if (!maPackedFileEntryVector.empty()) { // already backups there, check if different from last entry @@ -1630,7 +1628,7 @@ namespace // here the uncompress flag has to be determined, true // means to add the file compressed, false means to add it // uncompressed - bRetval = aLastEntry.copy_content(rHandle, true); + bool bRetval = aLastEntry.copy_content(rHandle, true); if (bRetval) { diff --git a/comphelper/source/windows/windows_process.cxx b/comphelper/source/windows/windows_process.cxx index e71f28be545b..f334cfc4ffbe 100644 --- a/comphelper/source/windows/windows_process.cxx +++ b/comphelper/source/windows/windows_process.cxx @@ -21,7 +21,6 @@ */ static int ArgStrLen(const wchar_t *s) { - int backslashes = 0; int i = wcslen(s); BOOL hasDoubleQuote = wcschr(s, L'"') != nullptr; // Only add doublequotes if the string contains a space or a tab @@ -34,6 +33,7 @@ static int ArgStrLen(const wchar_t *s) if (hasDoubleQuote) { + int backslashes = 0; while (*s) { if (*s == '\\') @@ -69,7 +69,6 @@ static int ArgStrLen(const wchar_t *s) */ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) { - int backslashes = 0; BOOL hasDoubleQuote = wcschr(s, L'"') != nullptr; // Only add doublequotes if the string contains a space or a tab BOOL addDoubleQuotes = wcspbrk(s, L" \t") != nullptr; @@ -82,7 +81,7 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) if (hasDoubleQuote) { - int i; + int backslashes = 0; while (*s) { if (*s == '\\') @@ -94,7 +93,7 @@ static wchar_t* ArgToString(wchar_t *d, const wchar_t *s) if (*s == '"') { // Escape the doublequote and all backslashes preceding the doublequote - for (i = 0; i <= backslashes; ++i) + for (int i = 0; i <= backslashes; ++i) { *d = '\\'; ++d; |