mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
cookies: Use strrchr instead of ad-hoc loop.
The size and speed of the object code probably don't change much, but the source becomes easier to read.
This commit is contained in:
parent
3e32131469
commit
e8233fa06a
@ -400,14 +400,10 @@ set_cookie(struct uri *uri, unsigned char *str)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (path_end = path + strlen(path) - 1;
|
path_end = strrchr(path, '/');
|
||||||
path_end >= path; path_end--) {
|
if (path_end)
|
||||||
if (*path_end == '/') {
|
|
||||||
path_end[1] = '\0';
|
path_end[1] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: /* error */
|
default: /* error */
|
||||||
done_cookie(cookie);
|
done_cookie(cookie);
|
||||||
|
Loading…
Reference in New Issue
Block a user