getline() is GNU extension and as such is non-portable.
svn path=/trunk/kdebase/kwin/; revision=379456
This commit is contained in:
parent
5f824cbed0
commit
9375d225d5
1 changed files with 4 additions and 6 deletions
|
@ -2130,9 +2130,8 @@ setParameter(char *line){
|
||||||
void
|
void
|
||||||
loadConfig(char *filename){
|
loadConfig(char *filename){
|
||||||
FILE *file = NULL;
|
FILE *file = NULL;
|
||||||
char *line = NULL;
|
char line[ 1024 ];
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
int ret = -1;
|
|
||||||
Bool wasNull = False;
|
Bool wasNull = False;
|
||||||
Bool section = False;
|
Bool section = False;
|
||||||
|
|
||||||
|
@ -2158,12 +2157,13 @@ loadConfig(char *filename){
|
||||||
}
|
}
|
||||||
|
|
||||||
/*find section*/
|
/*find section*/
|
||||||
while( !section && getline(&line, &length, file) != -1 ){
|
while( !section && fgets(line, 1023, file) != -1 ){
|
||||||
if( strcmp(line, "[xcompmgr]\n") == 0 )
|
if( strcmp(line, "[xcompmgr]\n") == 0 )
|
||||||
section = True;
|
section = True;
|
||||||
}
|
}
|
||||||
/*read and set values*/
|
/*read and set values*/
|
||||||
while( section && (ret = getline(&line, &length, file)) != -1 ){
|
while( section && fgets(line, 1023, file) != NULL ){
|
||||||
|
int ret = strlen( line );
|
||||||
if( ret > 1 ){
|
if( ret > 1 ){
|
||||||
if( *line == '[' )/*found new section - maybe check for '\n'?*/
|
if( *line == '[' )/*found new section - maybe check for '\n'?*/
|
||||||
break;
|
break;
|
||||||
|
@ -2177,8 +2177,6 @@ loadConfig(char *filename){
|
||||||
free(filename);
|
free(filename);
|
||||||
filename = NULL;
|
filename = NULL;
|
||||||
}
|
}
|
||||||
free(line);
|
|
||||||
line = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue