mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
0fea79cc8f
Likely some new bugs were introduced by this change. The long term goal is clean compilation by g++.
16 lines
352 B
C
16 lines
352 B
C
/* Cookie path matching */
|
|
|
|
#include <string.h>
|
|
#include "cookies/path.h"
|
|
|
|
int
|
|
is_path_prefix(char *cookiepath, char *requestpath)
|
|
{
|
|
int dl = strlen(cookiepath);
|
|
|
|
if (memcmp(cookiepath, requestpath, dl)) return 0;
|
|
|
|
return (!memcmp(cookiepath, requestpath, dl)
|
|
&& (cookiepath[dl - 1] == '/' || requestpath[dl] == '/' || requestpath[dl] == '\0'));
|
|
}
|