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)) {
|
||||
if (0 == strncmp("//", sLine, 2))
|
||||
continue;
|
||||
if ('#' == sLine[0])
|
||||
if (0 == strncmp("#", sLine, 1))
|
||||
continue;
|
||||
if (';' == sLine[0])
|
||||
if (0 == strncmp(";", sLine, 1))
|
||||
continue;
|
||||
wTmp = strchr(sLine, '=');
|
||||
if ((NULL != wTmp) && (1 == flag)) {
|
||||
sLine[strlen(sLine) - 1] = '\0';
|
||||
if (0 == strncmp(key, sLine, strlen(key)) && !(strncasecmp(strtok(sLine, "="), key, strlen(strtok(sLine, "="))))) {
|
||||
//printf("%s\n", sLine);
|
||||
fclose(fp);
|
||||
while (*(wTmp + 1) == ' ') {
|
||||
wTmp++;
|
||||
|
Loading…
Reference in New Issue
Block a user