Remove references to PATH_MAX macro

Since the macro PATH_MAX is not defined on every system (GNU/Hurd being
one of those who do not define it), we remove all references to this
macro. Instead, we use a buffer of arbitraty size and grow it when
needed to contain paths.
This commit is contained in:
Lancelot SIX
2013-11-21 22:03:49 +01:00
committed by Michael Stapelberg
parent 4f5e0e794f
commit f22995393a
5 changed files with 78 additions and 27 deletions

View File

@ -159,8 +159,9 @@ static void handle_button_release(xcb_connection_t *conn, xcb_button_release_eve
fclose(script);
char *link_path;
char *exe_path = get_exe_path(argv0);
sasprintf(&link_path, "%s.nagbar_cmd", script_path);
symlink(get_exe_path(argv0), link_path);
symlink(exe_path, link_path);
char *terminal_cmd;
sasprintf(&terminal_cmd, "i3-sensible-terminal -e %s", link_path);
@ -172,6 +173,7 @@ static void handle_button_release(xcb_connection_t *conn, xcb_button_release_eve
free(link_path);
free(terminal_cmd);
free(script_path);
free(exe_path);
/* TODO: unset flag, re-render */
}