summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christoph Lohmann 2013-03-14 19:14:44 +0100
committerGravatar Christoph Lohmann 2013-03-14 19:14:44 +0100
commita69c41ccac3141784140852c9d3935049d188d0f (patch)
tree201d2f358a0a295f60c9949af40c54c4a800170f
parentAdding a default font size option. (diff)
Support relative paths for surf.
Thanks Kurt Van Dijck <kurt.van.dijck@eia.be>!
Diffstat (limited to '')
-rw-r--r--surf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/surf.c b/surf.c
index 830665a..1ad5ace 100644
--- a/surf.c
+++ b/surf.c
@@ -577,12 +577,13 @@ loaduri(Client *c, const Arg *arg) {
char *u, *rp;
const char *uri = (char *)arg->v;
Arg a = { .b = FALSE };
+ struct stat st;
if(strcmp(uri, "") == 0)
return;
/* In case it's a file path. */
- if(uri[0] == '/') {
+ if(stat(uri, &st) == 0) {
rp = realpath(uri, NULL);
u = g_strdup_printf("file://%s", rp);
free(rp);
@@ -889,11 +890,12 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d) {
if(ev->atom == atoms[AtomFind]) {
arg.b = TRUE;
find(c, &arg);
+
return GDK_FILTER_REMOVE;
- }
- else if(ev->atom == atoms[AtomGo]) {
+ } else if(ev->atom == atoms[AtomGo]) {
arg.v = getatom(c, AtomGo);
loaduri(c, &arg);
+
return GDK_FILTER_REMOVE;
}
}
retro' width='13' height='13' alt='Gravatar' /> Hiltjo Posthuma 1-3/+9 2015-07-19fix prompt color style how it used to beGravatar Hiltjo Posthuma 1-1/+1 2015-06-27Use libdraw: add Xft and fallback-fonts support to graphics libGravatar Hiltjo Posthuma 11-316/+684 2014-09-17applied Hiltjo's patch as suggested on the ml to fix ControlMask for C-j and C-mGravatar Anselm R Garbe 2-2/+5 2014-07-30fix crash with ctrl-enter as inputGravatar Hiltjo Posthuma 1-1/+2 2014-05-29updated copyright notices in LICENSE and dmenu.c fileGravatar Anselm R Garbe 2-2/+2 2013-08-13applied Martin Kühl's inverse matching flag to stestGravatar Anselm R Garbe 2-4/+7 2013-08-02applied Martti Kühne's dmenu monitor patchGravatar Anselm R Garbe 3-4/+14 2013-06-28accepted vi'is exit approach ^[ (suggested by Arkaduisz)Gravatar Anselm R Garbe 1-0/+2