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:
Anthony Minessale 2007-12-06 20:03:27 +00:00
parent 3e439b248f
commit 5098f7a174
5 changed files with 8 additions and 8 deletions

View File

@ -38,7 +38,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa
char *path = NULL;
char path_buf[1024];
if (file_path[0] == '/') {
if (switch_is_file_path(file_path)) {
path = file_path;
} else {
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;
if (!(f = fopen(path, "r"))) {
if (file_path[0] != '/') {
if (!switch_is_file_path(file_path)) {
int last = -1;
char *var, *val;

View File

@ -88,7 +88,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
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);
path = epath;
}

View File

@ -39,7 +39,7 @@ static void db_pick_path(char *dbname, char *buf, switch_size_t size)
{
memset(buf, 0, size);
if (strchr(dbname, '/')) {
if (switch_is_file_path(dbname)) {
strncpy(buf, dbname, size);
} else {
snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);

View File

@ -635,10 +635,10 @@ 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_set_loops(ringback.audio_buffer, -1);
if (*ringback_data == '/') {
if (switch_is_file_path(ringback_data)) {
char *ext;
if ((ext = strrchr(ringback_data, '.'))) {
switch_core_session_set_read_codec(session, &write_codec);
ext++;

View File

@ -770,7 +770,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
return SWITCH_STATUS_FALSE;
}
if (*file == '/') {
if (switch_is_file_path(file)) {
path = switch_core_strdup(loadable_modules.pool, file);
file = (char *)switch_cut_path(file);
if ((dot = strchr(file, '.'))) {