修改iniparser适配ssid的特殊key

https://github.com/ndevilla/iniparser

下载iniparser

修改src/iniparser.c

支持‘;“#的获取

static line_status iniparser_line(

正则表达式

https://www.cnblogs.com/LiuYanYGZ/p/10300745.html

根据正则表达式修改为如下

支持psk                     =      '434':!"@3#123!@#'

支持所有字符的获取'434':!"@3#123!@#'

} else if (sscanf (line, "%[^=] = %[^\n]", key, value) == 2) {
        #if 0
        else if (sscanf (line, "%[^=] = \"%[^\"]\"", key, value) == 2
           ||  sscanf (line, "%[^=] = '%[^\']'",   key, value) == 2) {
        #endif
        /* Usual key=value with quotes, with or without comments */
        strstrip(key);
        strlwc(key, key, len);
        /* Don't strip spaces from values surrounded with quotes */
        sta = LINE_VALUE ;
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章