From e4d85e568b4eae145e6dad5ddbcd37734d35ba3b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 23 Mar 2011 17:56:55 +0100 Subject: [PATCH] fix bug with config file parsing with \r --- coreapi/linphonecore.c | 2 +- coreapi/lpconfig.c | 4 +++- mediastreamer2 | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 062e345b0..87488ba8e 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -435,13 +435,13 @@ static void sound_config_read(LinphoneCore *lc) tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING; tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf); if (ortp_file_exist(tmpbuf)==-1) { + ms_warning("%s does not exist",tmpbuf); tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING; } if (strstr(tmpbuf,".wav")==NULL){ /* it currently uses old sound files, so replace them */ tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING; } - linphone_core_set_ring(lc,tmpbuf); tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index 9e5cabc96..a7dbac214 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -177,7 +177,9 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){ if (sscanf(tmp,"%s",key)>0){ pos1++; - pos2=strchr(pos1,'\n'); + pos2=strchr(pos1,'\r'); + if (pos2==NULL) + pos2=strchr(pos1,'\n'); if (pos2==NULL) pos2=pos1+strlen(pos1); else { *pos2='\0'; /*replace the '\n' */ diff --git a/mediastreamer2 b/mediastreamer2 index 6f0c042a6..5c139fbb2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 6f0c042a6facbb7bc21ff6e56151d762e1fb9c8e +Subproject commit 5c139fbb21e7715b36a0b7e609d821f74dd01b8d