Replace ternary operators in cipherPathWithoutRoot with if clause

Adds a few lines but makes clear what is happening.
This commit is contained in:
Jakob Unterwurzacher 2014-11-30 22:44:16 +01:00
parent 8eea3be2db
commit 73b2f7c850

View File

@ -304,10 +304,14 @@ string DirNode::cipherPathWithoutRoot(const char *plaintextPath) {
string DirNode::plainPath(const char *cipherPath_) {
try {
// Handle special absolute path encodings.
char mark = fsConfig->reverseEncryption ? '/' : '+';
char mark = '+';
string prefix = "/";
if (fsConfig->reverseEncryption) {
mark = '/';
prefix = "+";
}
if (cipherPath_[0] == mark) {
return string(fsConfig->reverseEncryption ? "+" : "/") +
naming->decodeName(cipherPath_ + 1, strlen(cipherPath_ + 1));
return prefix + naming->decodeName(cipherPath_ + 1, strlen(cipherPath_ + 1));
}
// Default.