[Box Backup-dev] COMMIT r383 - box/chris/win32/vc2005-compile-fixes/bin/bbackupquery
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Feb 4 23:04:15 GMT 2006
Author: chris
Date: 2006-02-04 23:04:15 +0000 (Sat, 04 Feb 2006)
New Revision: 383
Modified:
box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp
Log:
* BackupQueries.cpp
- Fixed output formatting
- Convert UTF-8 to console format instead of using wprintf(), which is borked
Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp 2006-02-04 23:03:31 UTC (rev 382)
+++ box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp 2006-02-04 23:04:15 UTC (rev 383)
@@ -337,13 +337,12 @@
{
char* pMsg = "Directory '%s' not found on store\n";
#ifdef WIN32
- WCHAR* pMsgBuffer = ConvertUtf8ToMultiByte(pMsg);
- WCHAR* pNameBuffer = ConvertUtf8ToMultiByte(args[0].c_str());
- wprintf(pMsgBuffer, pNameBuffer);
+ char* pNameBuffer = ConvertUtf8ToConsole(
+ args[0].c_str());
+ printf(pMsg, pNameBuffer);
delete [] pNameBuffer;
- delete [] pMsgBuffer;
#else
- printf(msg, args[0].c_str());
+ printf(pMsg, args[0].c_str());
#endif
return;
}
@@ -435,7 +434,9 @@
if(opts[LIST_OPTION_TIMES])
{
// Show times...
- printf("%s ", BoxTimeToISO8601String(en->GetModificationTime()));
+ std::string time = BoxTimeToISO8601String(
+ en->GetModificationTime());
+ printf("%s ", time.c_str());
}
if(opts[LIST_OPTION_DISPLAY_HASH])
@@ -460,12 +461,10 @@
if(!FirstLevel)
{
#ifdef WIN32
- pMsgBuffer = ConvertUtf8ToMultiByte("%s");
- pNameBuffer = ConvertUtf8ToMultiByte(rListRoot);
- wprintf(pMsgBuffer, pNameBuffer);
+ char* pNameBuffer = ConvertUtf8ToConsole(
+ rListRoot.c_str());
+ printf("%s/", pNameBuffer);
delete [] pNameBuffer;
- delete [] pMsgBuffer;
- printf("/");
#else
printf("%s/", rListRoot.c_str());
#endif
@@ -473,12 +472,10 @@
#ifdef WIN32
{
- pMsgBuffer = ConvertUtf8ToMultiByte("%s");
- pNameBuffer = ConvertUtf8ToMultiByte(
+ char* pNameBuffer = ConvertUtf8ToConsole(
clear.GetClearFilename().c_str());
- wprintf(pMsgBuffer, pNameBuffer);
+ printf("%s", pNameBuffer);
delete [] pNameBuffer;
- delete [] pMsgBuffer;
}
#else
printf("%s", clear.GetClearFilename().c_str());
@@ -488,6 +485,8 @@
{
printf("[FILENAME NOT ENCRYPTED]");
}
+
+ printf("\n");
// Directory?
if((en->GetFlags() & BackupStoreDirectory::Entry::Flags_Dir) != 0)
More information about the Boxbackup-dev
mailing list