修改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 ;
    }

 

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