318 |
|
|
319 |
regcomp(&creg, reg, REG_EXTENDED | REG_ICASE); |
regcomp(&creg, reg, REG_EXTENDED | REG_ICASE); |
320 |
|
|
321 |
while ((line = strsep(&c, "\n")) && |
line = strtok_r(c, "\n", &c); |
322 |
!regexec(&creg, line, 4, match, 0)) { |
while (line && !regexec(&creg, line, 4, match, 0)) { |
323 |
user[0] = serv[0] = 0; |
user[0] = serv[0] = 0; |
324 |
|
|
325 |
strncat(serv, line + match[1].rm_so, |
strncat(serv, line + match[1].rm_so, |
330 |
if ((pe = (char *)find_password(user, serv))) |
if ((pe = (char *)find_password(user, serv))) |
331 |
strncat(pe, line + match[3].rm_so, |
strncat(pe, line + match[3].rm_so, |
332 |
min(match[3].rm_eo - match[3].rm_so, PASSWORD_LEN - 1)); |
min(match[3].rm_eo - match[3].rm_so, PASSWORD_LEN - 1)); |
333 |
|
|
334 |
|
line = strtok_r(NULL, "\n", &c); |
335 |
} |
} |
336 |
|
|
337 |
regfree(&creg); |
regfree(&creg); |