From c774d967dd5392615b5fde65177cc9f0ca0ec8fb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 7 Oct 2010 13:44:04 +0000 Subject: Finish support for -i option in bbackupquery (thanks to Achim for noticing) (forward port to trunk). --- bin/bbackupquery/BackupQueries.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index d5f31232..2278b668 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -455,9 +455,9 @@ QueryCommandSpecification commands[] = {CompleteRestoreRemoteDirOrId, CompleteLocalDir} }, { "help", "", Command_Help, {} }, { "usage", "m", Command_Usage, {} }, - { "undelete", "", Command_Undelete, + { "undelete", "i", Command_Undelete, {CompleteGetFileOrId} }, - { "delete", "", Command_Delete, {CompleteGetFileOrId} }, + { "delete", "i", Command_Delete, {CompleteGetFileOrId} }, { NULL, NULL, Command_Unknown, {} } }; @@ -1418,8 +1418,7 @@ void BackupQueries::CommandGetObject(const std::vector &args, const // object ID, depending on opts['i'], where name can // include a path) and return the file ID, placing the // directory ID in *pDirIdOut and the filename part -// of the path (if not looking up by ID and not NULL) -// in *pFileNameOut. +// of the path in *pFileNameOut (if not NULL). // Created: 2008-09-12 // // -------------------------------------------------------------------------- @@ -1449,11 +1448,6 @@ int64_t BackupQueries::FindFileID(const std::string& rNameOrIdString, return 0; } } - - if(pFileNameOut) - { - *pFileNameOut = fileName; - } } BackupStoreFilenameClear fn(fileName); @@ -1516,6 +1510,12 @@ int64_t BackupQueries::FindFileID(const std::string& rNameOrIdString, *pFlagsOut = en->GetFlags(); } + if(pFileNameOut) + { + BackupStoreFilenameClear entryName(en->GetName()); + *pFileNameOut = entryName.GetClearFilename(); + } + return fileId; } -- cgit v1.2.3