openbsd-ports/print/apvlv/patches/patch-src_ApvlvUtil_cpp
landry 7e9761a729 Import apvlv 0.0.9.6, A PDF Viewer Like Vim.
Apvlv is a PDF Viewer with vim-like keybindings using poppler rendering
library (that means it won't render pdf that evince and epdfview already
don't render).
For example, <Ctrl-f> for next page, <Ctrl-b> to previous page,
'k','j','h','l' to scrolling a page up, down, left or right, and so on.
It support lots of other shortcuts explained in the provided pdf
documentation, shown when starting it without arguments.
2010-05-13 16:05:05 +00:00

33 lines
947 B
Plaintext

$OpenBSD: patch-src_ApvlvUtil_cpp,v 1.1.1.1 2010/05/13 16:05:05 landry Exp $
HOME and PWD are not always set in env.
--- src/ApvlvUtil.cpp.orig Tue Apr 20 03:01:33 2010
+++ src/ApvlvUtil.cpp Tue May 4 10:44:58 2010
@@ -28,6 +28,9 @@
#include "ApvlvUtil.hpp"
+#include <sys/types.h>
+#include <unistd.h>
+
#include <stdlib.h>
#ifndef WIN32
#include <sys/wait.h>
@@ -84,7 +87,7 @@ namespace apvlv
gchar *home =
g_win32_get_package_installation_directory_of_module (NULL);
#else
- char *home = getenv ("HOME");
+ const gchar *home = g_get_home_dir();
#endif
g_snprintf (abpath, sizeof abpath, "%s%s", home, ++path);
}
@@ -95,7 +98,7 @@ namespace apvlv
GetCurrentDirectoryA (sizeof cpath, cpath);
g_snprintf (abpath, sizeof abpath, "%s\\%s", cpath, path);
#else
- snprintf (abpath, sizeof abpath, "%s/%s", getenv ("PWD"), path);
+ snprintf (abpath, sizeof abpath, "%s/%s", g_get_current_dir(), path);
#endif
}