lejp handle name elements starting with dot
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
3bd3a41e97
commit
37320ced18
1 changed files with 10 additions and 2 deletions
12
lwsws/lejp.c
12
lwsws/lejp.c
|
@ -115,7 +115,15 @@ lejp_check_path_match(struct lejp_ctx *ctx)
|
|||
}
|
||||
ctx->wild[ctx->wildcount++] = p - ctx->path;
|
||||
q++;
|
||||
while (*p && *p != '.')
|
||||
/*
|
||||
* if * has something after it, match to .
|
||||
* if ends with *, eat everything.
|
||||
* This implies match sequences must be ordered like
|
||||
* x.*.*
|
||||
* x.*
|
||||
* if both options are possible
|
||||
*/
|
||||
while (*p && (*p != '.' || !*q))
|
||||
p++;
|
||||
}
|
||||
if (*p || *q)
|
||||
|
@ -140,7 +148,7 @@ lejp_get_wildcard(struct lejp_ctx *ctx, int wildcard, char *dest, int len)
|
|||
|
||||
n = ctx->wild[wildcard];
|
||||
|
||||
while (--len && n < ctx->ppos && ctx->path[n] != '.')
|
||||
while (--len && n < ctx->ppos && (n == ctx->wild[wildcard] || ctx->path[n] != '.'))
|
||||
*dest++ = ctx->path[n++];
|
||||
|
||||
*dest = '\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue