From 73b2f7c8505f2b7a81d30b04bcf5a5256b252ccd Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 30 Nov 2014 22:44:16 +0100 Subject: [PATCH] Replace ternary operators in cipherPathWithoutRoot with if clause Adds a few lines but makes clear what is happening. --- encfs/DirNode.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/encfs/DirNode.cpp b/encfs/DirNode.cpp index 3b88c37..7d08b77 100644 --- a/encfs/DirNode.cpp +++ b/encfs/DirNode.cpp @@ -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.