mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 23:52:22 +02:00
Farewell glib-1.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4509 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
cb1287ab63
commit
afa4292466
13 changed files with 9 additions and 507 deletions
|
|
@ -37,54 +37,6 @@ char *irssi_binary = NULL;
|
|||
|
||||
static char **session_args;
|
||||
|
||||
#ifndef HAVE_GLIB2
|
||||
static char *g_find_program_in_path(const char *path)
|
||||
{
|
||||
const char *envpath;
|
||||
char **paths, **tmp;
|
||||
char *str;
|
||||
char *result = NULL;
|
||||
|
||||
if (g_path_is_absolute(path)) {
|
||||
/* full path - easy */
|
||||
if(access(path, X_OK) == -1)
|
||||
return NULL;
|
||||
else
|
||||
return g_strdup(path);
|
||||
}
|
||||
|
||||
if (strchr(path, G_DIR_SEPARATOR) != NULL) {
|
||||
/* relative path */
|
||||
str = g_get_current_dir();
|
||||
result = g_strconcat(str, G_DIR_SEPARATOR_S, path, NULL);
|
||||
g_free(str);
|
||||
if (access(result, X_OK) == -1) {
|
||||
g_free(result);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
return result;
|
||||
}
|
||||
|
||||
/* we'll need to find it from path. */
|
||||
envpath = g_getenv("PATH");
|
||||
if (envpath == NULL) return NULL;
|
||||
|
||||
paths = g_strsplit(envpath, ":", -1);
|
||||
for (tmp = paths; *tmp != NULL; tmp++) {
|
||||
str = g_strconcat(*tmp, G_DIR_SEPARATOR_S, path, NULL);
|
||||
if (access(str, X_OK) == 0) {
|
||||
result = str;
|
||||
break;
|
||||
}
|
||||
g_free(str);
|
||||
}
|
||||
g_strfreev(paths);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
void session_set_binary(const char *path)
|
||||
{
|
||||
g_free_and_null(irssi_binary);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue