mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-18 02:22:30 +00:00
Add minor improvements and cleanup
This commit is contained in:
parent
9e3e985ae5
commit
feed0d2b0e
163 changed files with 2286 additions and 2245 deletions
|
@ -20,11 +20,11 @@
|
|||
#include "libc/str/str.h"
|
||||
|
||||
int getkvlin(const char *name, const char *const unsorted[]) {
|
||||
unsigned i, n;
|
||||
if (unsorted) {
|
||||
unsigned namelen = strlen(name);
|
||||
for (int i = 0; unsorted[i]; ++i) {
|
||||
if (strncmp(unsorted[i], name, namelen) == 0 &&
|
||||
unsorted[i][namelen] == '=') {
|
||||
n = strlen(name);
|
||||
for (i = 0; unsorted[i]; ++i) {
|
||||
if (strncmp(unsorted[i], name, n) == 0 && unsorted[i][n] == '=') {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue