Allow data path to end with a list for get and ls

Change-Id: I3facc8315fa6192da4318012a85121de37e7314b
diff --git a/src/parser_context.cpp b/src/parser_context.cpp
index f5e2d32..c240984 100644
--- a/src/parser_context.cpp
+++ b/src/parser_context.cpp
@@ -9,9 +9,9 @@
 #include "parser_context.hpp"
 ParserContext::ParserContext(const Schema& schema, const schemaPath_& curDir)
     : m_schema(schema)
+    , m_curPath(curDir)
+    , m_curPathOrig(curDir)
 {
-    m_curPath = curDir;
-
     if (!m_curPath.m_nodes.empty() && m_curPath.m_nodes.at(0).m_prefix)
         m_topLevelModulePresent = true;
 }