aboutsummaryrefslogtreecommitdiff
path: root/src/path.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-09 07:22:42 +0000
committer_ov4 <ov4@ov4.org>2026-10-09 07:22:42 +0000
commitbeadcf1f0d9cf8b9c0b14683bf40d27c142d33c5 (patch)
treec996d716cad78bb24870996d751715e8387d3024 /src/path.cc
parent091db10e0f5e8e95095f30cef34d51e23fc01abb (diff)
add history load/save
Diffstat (limited to 'src/path.cc')
-rw-r--r--src/path.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/path.cc b/src/path.cc
index 103e2c5..30e81cc 100644
--- a/src/path.cc
+++ b/src/path.cc
@@ -1,5 +1,12 @@
#include "path.h"
+#include <pwd.h>
+#include <unistd.h>
+
+#include "global.h"
+#include "util/string.h"
+#include "util/io.h"
+
namespace ov4
{
@@ -67,5 +74,10 @@ string get_current_dir()
return safe_str(getcwd(buf, MAXLINE));
}
+string get_home_dir()
+{
+ return getpwuid(getuid())->pw_dir;
+}
+
}