mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-07 04:53:37 -04: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'));
|
|
}
|