Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/multimedia/ccextractor/files/patch-src_GUI_file__browser.c
19260 views
1
--- src/GUI/file_browser.c.orig 2021-12-15 17:05:37 UTC
2
+++ src/GUI/file_browser.c
3
@@ -13,6 +13,7 @@
4
#endif
5
#if UNIX
6
#include <unistd.h>
7
+#include <pwd.h>
8
#endif
9
#include <GL/glew.h>
10
#include <string.h>
11
@@ -325,8 +326,13 @@ void file_browser_init(struct file_browser *browser, s
12
if (!home)
13
home = getenv("USERPROFILE");
14
#else
15
- if (!home)
16
- home = getpwuid(getuid());
17
+ if (!home) {
18
+ struct passwd *pwd;
19
+
20
+ pwd = getpwuid(getuid());
21
+ if (pwd != NULL)
22
+ home = pwd->pw_dir;
23
+ }
24
#endif
25
{
26
size_t l;
27
28