diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-17 21:29:24 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
commit | 8d5fe1790a01969545e6cc1872ac629490692ac2 (patch) | |
tree | 86447af4a5fc74eed362444dbe631bcdc9018d9d /modules/pam_exec | |
parent | 13ec29f9c11e9ee73fc0f62dd56b3dffc7742c39 (diff) | |
download | pam-8d5fe1790a01969545e6cc1872ac629490692ac2.tar.gz pam-8d5fe1790a01969545e6cc1872ac629490692ac2.tar.bz2 pam-8d5fe1790a01969545e6cc1872ac629490692ac2.zip |
Introduce pam_str_skip_icase_prefix_len and pam_str_skip_icase_prefix
Every time I see a code like
if (strncasecmp(argv, "remember=", 9) == 0)
options->remember = strtol(&argv[9], NULL, 10);
my eyes are bleeding.
Similar to pam_str_skip_prefix_len() and pam_str_skip_prefix(),
introduce a new helper inline function pam_str_skip_icase_prefix_len()
and a new macro pam_str_skip_icase_prefix() on top of it, to be used
in subsequent commits to cleanup the ugliness.
* libpam/include/pam_inline.h (pam_str_skip_icase_prefix_len): New
function.
(pam_str_skip_icase_prefix): New macro.
Diffstat (limited to 'modules/pam_exec')
0 files changed, 0 insertions, 0 deletions