1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-03 08:07:17 -05:00

Introduced STRING_DIR_SEP for better portability

This commit is contained in:
Witold Filipczyk 2006-07-02 08:44:52 +02:00 committed by Witold Filipczyk
parent f9a452ece7
commit d1e5e0b7d2
6 changed files with 15 additions and 4 deletions

View File

@ -7,6 +7,10 @@
#include "osdep/unix/unix.h"
#include "osdep/win32/win32.h"
#ifndef STRING_DIR_SEP
#define STRING_DIR_SEP "/"
#endif
int get_system_env(void);
int get_e(unsigned char *env);
int is_xterm(void);

View File

@ -4,6 +4,9 @@
#ifdef CONFIG_OS_WIN32
#undef STRING_DIR_SEP
#define STRING_DIR_SEP "\\"
struct terminal;
void open_in_new_win32(struct terminal *term, unsigned char *exe_name,

View File

@ -30,6 +30,7 @@
#include "intl/gettext/libintl.h"
#include "main/event.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "osdep/signals.h"
#include "protocol/uri.h"
#include "scripting/lua/core.h"
@ -630,7 +631,7 @@ eval_function(LS, int num_args, int num_results)
static void
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;

View File

@ -11,6 +11,7 @@
#include "config/home.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/perl/core.h"
#include "util/file.h"
@ -27,7 +28,7 @@ extern char **environ;
static char *
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;
return NULL;

View File

@ -14,6 +14,7 @@
#include "config/home.h"
#include "intl/gettext/libintl.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/scripting.h"
#include "scripting/ruby/core.h"
#include "scripting/ruby/ruby.h"
@ -235,7 +236,7 @@ init_ruby(struct module *module)
path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, NULL);
} else {
path = stracpy(CONFDIR "/" RUBY_HOOKS_FILENAME);
path = stracpy(CONFDIR STRING_DIR_SEP RUBY_HOOKS_FILENAME);
}
if (!path) return;

View File

@ -9,6 +9,7 @@
#include "config/home.h"
#include "ecmascript/spidermonkey/util.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/scripting.h"
#include "scripting/smjs/core.h"
#include "scripting/smjs/elinks_object.h"
@ -114,7 +115,7 @@ smjs_load_hooks(void)
if (elinks_home) {
path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, NULL);
} else {
path = stracpy(CONFDIR "/" SMJS_HOOKS_FILENAME);
path = stracpy(CONFDIR STRING_DIR_SEP SMJS_HOOKS_FILENAME);
}
if (file_exists(path))