[Freeswitch-svn] [commit] r6546 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Thu Dec 6 15:03:28 EST 2007


Author: anthm
Date: Thu Dec  6 15:03:27 2007
New Revision: 6546

Modified:
   freeswitch/trunk/src/switch_config.c
   freeswitch/trunk/src/switch_core_asr.c
   freeswitch/trunk/src/switch_core_db.c
   freeswitch/trunk/src/switch_ivr_originate.c
   freeswitch/trunk/src/switch_loadable_module.c

Log:
fix file_path issues

Modified: freeswitch/trunk/src/switch_config.c
==============================================================================
--- freeswitch/trunk/src/switch_config.c	(original)
+++ freeswitch/trunk/src/switch_config.c	Thu Dec  6 15:03:27 2007
@@ -38,7 +38,7 @@
 	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 @@
 	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;
 

Modified: freeswitch/trunk/src/switch_core_asr.c
==============================================================================
--- freeswitch/trunk/src/switch_core_asr.c	(original)
+++ freeswitch/trunk/src/switch_core_asr.c	Thu Dec  6 15:03:27 2007
@@ -88,7 +88,7 @@
 
 	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;
 	}

Modified: freeswitch/trunk/src/switch_core_db.c
==============================================================================
--- freeswitch/trunk/src/switch_core_db.c	(original)
+++ freeswitch/trunk/src/switch_core_db.c	Thu Dec  6 15:03:27 2007
@@ -39,7 +39,7 @@
 {
 
 	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);

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Thu Dec  6 15:03:27 2007
@@ -635,10 +635,10 @@
 
 							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++;

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Thu Dec  6 15:03:27 2007
@@ -770,7 +770,7 @@
 		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, '.'))) {



More information about the Freeswitch-svn mailing list