diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-28 18:27:29 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-28 18:27:29 +0100 |
commit | fc6bc92e116d3891671a77bc4564047eefd69f95 (patch) | |
tree | 9fd31f538af9cea9f144ece7e7b7cd2333d2bd81 /source4/lib/registry/patchfile_preg.c | |
parent | d70eafc5c635255feafc7121b381e7044ac11854 (diff) | |
parent | afe8e533b9626fff8c59653972019d3f91bf136c (diff) | |
download | samba-fc6bc92e116d3891671a77bc4564047eefd69f95.tar.gz samba-fc6bc92e116d3891671a77bc4564047eefd69f95.tar.bz2 samba-fc6bc92e116d3891671a77bc4564047eefd69f95.zip |
Merge branch 'v4-0-trivial' into v4-0-test
(This used to be commit 6cbb241c05539cc62526a366094c9c472e6422a5)
Diffstat (limited to 'source4/lib/registry/patchfile_preg.c')
-rw-r--r-- | source4/lib/registry/patchfile_preg.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c index 9cc9a5dec2..0d39e67450 100644 --- a/source4/lib/registry/patchfile_preg.c +++ b/source4/lib/registry/patchfile_preg.c @@ -29,14 +29,14 @@ struct preg_data { int fd; }; -static WERROR preg_read_utf16(int fd, char *c) +static WERROR preg_read_utf16(struct smb_iconv_convenience *ic, int fd, char *c) { uint16_t v; if (read(fd, &v, 2) < 2) { return WERR_GENERAL_FAILURE; } - push_codepoint(lp_iconv_convenience(global_loadparm), c, v); + push_codepoint(ic, c, v); return WERR_OK; } @@ -123,6 +123,7 @@ _PUBLIC_ WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename, * Load diff file */ _PUBLIC_ WERROR reg_preg_diff_load(int fd, + struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data) { @@ -162,7 +163,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, while(1) { uint32_t value_type, length; - if (!W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr))) { + if (!W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr))) { break; } if (*buf_ptr != '[') { @@ -173,7 +174,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, /* Get the path */ buf_ptr = buf; - while (W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && + while (W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) && *buf_ptr != ';' && buf_ptr-buf < buf_size) { buf_ptr++; } @@ -181,7 +182,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, /* Get the name */ buf_ptr = buf; - while (W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && + while (W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) && *buf_ptr != ';' && buf_ptr-buf < buf_size) { buf_ptr++; } @@ -195,7 +196,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, } /* Read past delimiter */ buf_ptr = buf; - if (!(W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && + if (!(W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) && *buf_ptr == ';') && buf_ptr-buf < buf_size) { DEBUG(0, ("Error in PReg file.\n")); ret = WERR_GENERAL_FAILURE; @@ -209,7 +210,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, } /* Read past delimiter */ buf_ptr = buf; - if (!(W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && + if (!(W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) && *buf_ptr == ';') && buf_ptr-buf < buf_size) { DEBUG(0, ("Error in PReg file.\n")); ret = WERR_GENERAL_FAILURE; @@ -227,7 +228,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, /* Check if delimiter is in place (whine if it isn't) */ buf_ptr = buf; - if (!(W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && + if (!(W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) && *buf_ptr == ']') && buf_ptr-buf < buf_size) { DEBUG(0, ("Warning: Missing ']' in PReg file, expected ']', got '%c' 0x%x.\n", *buf_ptr, *buf_ptr)); |