mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
fix file_path issues
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6546 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
3e439b248f
commit
5098f7a174
@ -38,7 +38,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa
|
|||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
char path_buf[1024];
|
char path_buf[1024];
|
||||||
|
|
||||||
if (file_path[0] == '/') {
|
if (switch_is_file_path(file_path)) {
|
||||||
path = file_path;
|
path = file_path;
|
||||||
} else {
|
} else {
|
||||||
snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path);
|
snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path);
|
||||||
@ -53,7 +53,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa
|
|||||||
cfg->lockto = -1;
|
cfg->lockto = -1;
|
||||||
|
|
||||||
if (!(f = fopen(path, "r"))) {
|
if (!(f = fopen(path, "r"))) {
|
||||||
if (file_path[0] != '/') {
|
if (!switch_is_file_path(file_path)) {
|
||||||
int last = -1;
|
int last = -1;
|
||||||
char *var, *val;
|
char *var, *val;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
|
|||||||
|
|
||||||
assert(ah != NULL);
|
assert(ah != NULL);
|
||||||
|
|
||||||
if (*path != '/') {
|
if (!switch_is_file_path(path)) {
|
||||||
epath = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_PATH_SEPARATOR, path);
|
epath = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_PATH_SEPARATOR, path);
|
||||||
path = epath;
|
path = epath;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ static void db_pick_path(char *dbname, char *buf, switch_size_t size)
|
|||||||
{
|
{
|
||||||
|
|
||||||
memset(buf, 0, size);
|
memset(buf, 0, size);
|
||||||
if (strchr(dbname, '/')) {
|
if (switch_is_file_path(dbname)) {
|
||||||
strncpy(buf, dbname, size);
|
strncpy(buf, dbname, size);
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
|
snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
|
||||||
|
@ -636,7 +636,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0);
|
switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0);
|
||||||
switch_buffer_set_loops(ringback.audio_buffer, -1);
|
switch_buffer_set_loops(ringback.audio_buffer, -1);
|
||||||
|
|
||||||
if (*ringback_data == '/') {
|
if (switch_is_file_path(ringback_data)) {
|
||||||
char *ext;
|
char *ext;
|
||||||
|
|
||||||
if ((ext = strrchr(ringback_data, '.'))) {
|
if ((ext = strrchr(ringback_data, '.'))) {
|
||||||
|
@ -770,7 +770,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*file == '/') {
|
if (switch_is_file_path(file)) {
|
||||||
path = switch_core_strdup(loadable_modules.pool, file);
|
path = switch_core_strdup(loadable_modules.pool, file);
|
||||||
file = (char *)switch_cut_path(file);
|
file = (char *)switch_cut_path(file);
|
||||||
if ((dot = strchr(file, '.'))) {
|
if ((dot = strchr(file, '.'))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user