version 1.56, 2015/04/01 20:20:22 |
version 1.57, 2015/04/01 20:24:12 |
|
|
goto end; |
goto end; |
|
|
len = pmatch[1].rm_eo - pmatch[1].rm_so; |
len = pmatch[1].rm_eo - pmatch[1].rm_so; |
f = sort_malloc((len + 1) * sizeof(char)); |
|
|
|
strncpy(f, s + pmatch[1].rm_so, len); |
f = sort_malloc(len + 1); |
|
memcpy(f, s + pmatch[1].rm_so, len); |
f[len] = '\0'; |
f[len] = '\0'; |
|
|
if (second) { |
if (second) { |
|
|
|
|
if (pmatch[2].rm_eo > pmatch[2].rm_so) { |
if (pmatch[2].rm_eo > pmatch[2].rm_so) { |
len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; |
len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; |
c = sort_malloc((len + 1) * sizeof(char)); |
|
|
|
strncpy(c, s + pmatch[2].rm_so + 1, len); |
c = sort_malloc(len + 1); |
|
memcpy(c, s + pmatch[2].rm_so + 1, len); |
c[len] = '\0'; |
c[len] = '\0'; |
|
|
if (second) { |
if (second) { |
|
|
|
|
if (size1 < 1) |
if (size1 < 1) |
return -1; |
return -1; |
pos1 = sort_malloc((size1 + 1) * sizeof(char)); |
|
|
|
strncpy(pos1, s, size1); |
pos1 = sort_malloc(size1 + 1); |
|
memcpy(pos1, s, size1); |
pos1[size1] = '\0'; |
pos1[size1] = '\0'; |
|
|
ret = parse_pos(pos1, ks, mef_flags, false); |
ret = parse_pos(pos1, ks, mef_flags, false); |
|
|
goto end; |
goto end; |
|
|
len = pmatch[1].rm_eo - pmatch[1].rm_so; |
len = pmatch[1].rm_eo - pmatch[1].rm_so; |
f = sort_malloc((len + 1) * sizeof(char)); |
|
|
|
strncpy(f, s + pmatch[1].rm_so, len); |
f = sort_malloc(len + 1); |
|
memcpy(f, s + pmatch[1].rm_so, len); |
f[len] = '\0'; |
f[len] = '\0'; |
|
|
errno = 0; |
errno = 0; |
|
|
|
|
if (pmatch[2].rm_eo > pmatch[2].rm_so) { |
if (pmatch[2].rm_eo > pmatch[2].rm_so) { |
len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; |
len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; |
c = sort_malloc((len + 1) * sizeof(char)); |
|
|
|
strncpy(c, s + pmatch[2].rm_so + 1, len); |
c = sort_malloc((len + 1) * sizeof(char)); |
|
memcpy(c, s + pmatch[2].rm_so + 1, len); |
c[len] = '\0'; |
c[len] = '\0'; |
|
|
errno = 0; |
errno = 0; |
|
|
|
|
if (len >= sopts_size) |
if (len >= sopts_size) |
errx(2, "Invalid key position"); |
errx(2, "Invalid key position"); |
strncpy(sopts, s + pmatch[3].rm_so, len); |
memcpy(sopts, s + pmatch[3].rm_so, len); |
sopts[len] = '\0'; |
sopts[len] = '\0'; |
} |
} |
|
|