Repair the getinikeystring() function
This commit is contained in:
parent
a793745ce4
commit
70f4c55c8a
5
libini.c
5
libini.c
@ -20,15 +20,14 @@ int getinikeystring(char *title, char *key, char *filename, char *buf)
|
|||||||
while (NULL != fgets(sLine, BUFFER_SIZE, fp)) {
|
while (NULL != fgets(sLine, BUFFER_SIZE, fp)) {
|
||||||
if (0 == strncmp("//", sLine, 2))
|
if (0 == strncmp("//", sLine, 2))
|
||||||
continue;
|
continue;
|
||||||
if ('#' == sLine[0])
|
if (0 == strncmp("#", sLine, 1))
|
||||||
continue;
|
continue;
|
||||||
if (';' == sLine[0])
|
if (0 == strncmp(";", sLine, 1))
|
||||||
continue;
|
continue;
|
||||||
wTmp = strchr(sLine, '=');
|
wTmp = strchr(sLine, '=');
|
||||||
if ((NULL != wTmp) && (1 == flag)) {
|
if ((NULL != wTmp) && (1 == flag)) {
|
||||||
sLine[strlen(sLine) - 1] = '\0';
|
sLine[strlen(sLine) - 1] = '\0';
|
||||||
if (0 == strncmp(key, sLine, strlen(key)) && !(strncasecmp(strtok(sLine, "="), key, strlen(strtok(sLine, "="))))) {
|
if (0 == strncmp(key, sLine, strlen(key)) && !(strncasecmp(strtok(sLine, "="), key, strlen(strtok(sLine, "="))))) {
|
||||||
//printf("%s\n", sLine);
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
while (*(wTmp + 1) == ' ') {
|
while (*(wTmp + 1) == ' ') {
|
||||||
wTmp++;
|
wTmp++;
|
||||||
|
Loading…
Reference in New Issue
Block a user