mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-21 04:38:29 +00:00
fix bug with config file parsing with \r
This commit is contained in:
parent
32881a74b6
commit
e4d85e568b
3 changed files with 5 additions and 3 deletions
|
|
@ -435,13 +435,13 @@ static void sound_config_read(LinphoneCore *lc)
|
||||||
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
||||||
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
|
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
|
||||||
if (ortp_file_exist(tmpbuf)==-1) {
|
if (ortp_file_exist(tmpbuf)==-1) {
|
||||||
|
ms_warning("%s does not exist",tmpbuf);
|
||||||
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
||||||
}
|
}
|
||||||
if (strstr(tmpbuf,".wav")==NULL){
|
if (strstr(tmpbuf,".wav")==NULL){
|
||||||
/* it currently uses old sound files, so replace them */
|
/* it currently uses old sound files, so replace them */
|
||||||
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
|
||||||
}
|
}
|
||||||
|
|
||||||
linphone_core_set_ring(lc,tmpbuf);
|
linphone_core_set_ring(lc,tmpbuf);
|
||||||
|
|
||||||
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
|
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,8 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
|
||||||
if (sscanf(tmp,"%s",key)>0){
|
if (sscanf(tmp,"%s",key)>0){
|
||||||
|
|
||||||
pos1++;
|
pos1++;
|
||||||
|
pos2=strchr(pos1,'\r');
|
||||||
|
if (pos2==NULL)
|
||||||
pos2=strchr(pos1,'\n');
|
pos2=strchr(pos1,'\n');
|
||||||
if (pos2==NULL) pos2=pos1+strlen(pos1);
|
if (pos2==NULL) pos2=pos1+strlen(pos1);
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6f0c042a6facbb7bc21ff6e56151d762e1fb9c8e
|
Subproject commit 5c139fbb21e7715b36a0b7e609d821f74dd01b8d
|
||||||
Loading…
Add table
Reference in a new issue