mirror of
https://github.com/rkd77/elinks.git
synced 2025-05-18 00:48:57 -04:00
Introduced STRING_DIR_SEP for better portability
This commit is contained in:
parent
f9a452ece7
commit
d1e5e0b7d2
@ -7,6 +7,10 @@
|
|||||||
#include "osdep/unix/unix.h"
|
#include "osdep/unix/unix.h"
|
||||||
#include "osdep/win32/win32.h"
|
#include "osdep/win32/win32.h"
|
||||||
|
|
||||||
|
#ifndef STRING_DIR_SEP
|
||||||
|
#define STRING_DIR_SEP "/"
|
||||||
|
#endif
|
||||||
|
|
||||||
int get_system_env(void);
|
int get_system_env(void);
|
||||||
int get_e(unsigned char *env);
|
int get_e(unsigned char *env);
|
||||||
int is_xterm(void);
|
int is_xterm(void);
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_OS_WIN32
|
#ifdef CONFIG_OS_WIN32
|
||||||
|
|
||||||
|
#undef STRING_DIR_SEP
|
||||||
|
#define STRING_DIR_SEP "\\"
|
||||||
|
|
||||||
struct terminal;
|
struct terminal;
|
||||||
|
|
||||||
void open_in_new_win32(struct terminal *term, unsigned char *exe_name,
|
void open_in_new_win32(struct terminal *term, unsigned char *exe_name,
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "intl/gettext/libintl.h"
|
#include "intl/gettext/libintl.h"
|
||||||
#include "main/event.h"
|
#include "main/event.h"
|
||||||
#include "main/module.h"
|
#include "main/module.h"
|
||||||
|
#include "osdep/osdep.h"
|
||||||
#include "osdep/signals.h"
|
#include "osdep/signals.h"
|
||||||
#include "protocol/uri.h"
|
#include "protocol/uri.h"
|
||||||
#include "scripting/lua/core.h"
|
#include "scripting/lua/core.h"
|
||||||
@ -630,7 +631,7 @@ eval_function(LS, int num_args, int num_results)
|
|||||||
static void
|
static void
|
||||||
do_hooks_file(LS, unsigned char *prefix, unsigned char *filename)
|
do_hooks_file(LS, unsigned char *prefix, unsigned char *filename)
|
||||||
{
|
{
|
||||||
unsigned char *file = straconcat(prefix, "/", filename, NULL);
|
unsigned char *file = straconcat(prefix, STRING_DIR_SEP, filename, NULL);
|
||||||
|
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "config/home.h"
|
#include "config/home.h"
|
||||||
#include "main/module.h"
|
#include "main/module.h"
|
||||||
|
#include "osdep/osdep.h"
|
||||||
#include "scripting/perl/core.h"
|
#include "scripting/perl/core.h"
|
||||||
#include "util/file.h"
|
#include "util/file.h"
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ extern char **environ;
|
|||||||
static char *
|
static char *
|
||||||
get_global_hook_file(void)
|
get_global_hook_file(void)
|
||||||
{
|
{
|
||||||
static char buf[] = CONFDIR "/" PERL_HOOKS_FILENAME;
|
static char buf[] = CONFDIR STRING_DIR_SEP PERL_HOOKS_FILENAME;
|
||||||
|
|
||||||
if (file_exists(buf)) return buf;
|
if (file_exists(buf)) return buf;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "config/home.h"
|
#include "config/home.h"
|
||||||
#include "intl/gettext/libintl.h"
|
#include "intl/gettext/libintl.h"
|
||||||
#include "main/module.h"
|
#include "main/module.h"
|
||||||
|
#include "osdep/osdep.h"
|
||||||
#include "scripting/scripting.h"
|
#include "scripting/scripting.h"
|
||||||
#include "scripting/ruby/core.h"
|
#include "scripting/ruby/core.h"
|
||||||
#include "scripting/ruby/ruby.h"
|
#include "scripting/ruby/ruby.h"
|
||||||
@ -235,7 +236,7 @@ init_ruby(struct module *module)
|
|||||||
path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, NULL);
|
path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, NULL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
path = stracpy(CONFDIR "/" RUBY_HOOKS_FILENAME);
|
path = stracpy(CONFDIR STRING_DIR_SEP RUBY_HOOKS_FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!path) return;
|
if (!path) return;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "config/home.h"
|
#include "config/home.h"
|
||||||
#include "ecmascript/spidermonkey/util.h"
|
#include "ecmascript/spidermonkey/util.h"
|
||||||
#include "main/module.h"
|
#include "main/module.h"
|
||||||
|
#include "osdep/osdep.h"
|
||||||
#include "scripting/scripting.h"
|
#include "scripting/scripting.h"
|
||||||
#include "scripting/smjs/core.h"
|
#include "scripting/smjs/core.h"
|
||||||
#include "scripting/smjs/elinks_object.h"
|
#include "scripting/smjs/elinks_object.h"
|
||||||
@ -114,7 +115,7 @@ smjs_load_hooks(void)
|
|||||||
if (elinks_home) {
|
if (elinks_home) {
|
||||||
path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, NULL);
|
path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, NULL);
|
||||||
} else {
|
} else {
|
||||||
path = stracpy(CONFDIR "/" SMJS_HOOKS_FILENAME);
|
path = stracpy(CONFDIR STRING_DIR_SEP SMJS_HOOKS_FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(path))
|
if (file_exists(path))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user