mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +00:00
[common] option: use isspace from <ctype.h>
This commit is contained in:
parent
7cd0c55847
commit
c89518ead4
@ -22,6 +22,7 @@
|
|||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/stringutils.h"
|
#include "common/stringutils.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -508,7 +509,7 @@ bool option_load(const char * filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//rtrim
|
//rtrim
|
||||||
while(nameLen > 1 && (name[nameLen-1] == ' ' || name[nameLen-1] == '\t'))
|
while (nameLen > 1 && isspace(name[nameLen-1]))
|
||||||
--nameLen;
|
--nameLen;
|
||||||
name[nameLen] = '\0';
|
name[nameLen] = '\0';
|
||||||
expectValue = true;
|
expectValue = true;
|
||||||
@ -545,7 +546,7 @@ bool option_load(const char * filename)
|
|||||||
line = false;
|
line = false;
|
||||||
|
|
||||||
//ltrim
|
//ltrim
|
||||||
if (*len == 0 && (c == ' ' || c == '\t'))
|
if (*len == 0 && isspace(c))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (*len % 32 == 0)
|
if (*len % 32 == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user