The following commit has been merged in the master branch:
commit 3adb9397a0d82c0f42fd93455b69585693cf162a
Author: Guillem Jover <[email protected]>
Date: Mon Oct 5 04:12:07 2009 +0200
libdpkg: Change order and rename path_quote_filename arguments
Place the size at the end, and rename buf to dst, and s to src.
diff --git a/lib/dpkg/path.c b/lib/dpkg/path.c
index 3a2eefe..d9cb78c 100644
--- a/lib/dpkg/path.c
+++ b/lib/dpkg/path.c
@@ -77,40 +77,40 @@ path_skip_slash_dotslash(const char *path)
* - [email protected]
*/
char *
-path_quote_filename(char *buf, size_t size, const char *s)
+path_quote_filename(char *dst, const char *src, size_t size)
{
- char *r = buf;
+ char *r = dst;
while (size > 0) {
- switch (*s) {
+ switch (*src) {
case '\0':
- *buf = '\0';
+ *dst = '\0';
return r;
case '\\':
- *buf++ = '\\';
- *buf++ = '\\';
+ *dst++ = '\\';
+ *dst++ = '\\';
size -= 2;
break;
default:
- if (((*s) & 0x80) == '\0') {
- *buf++ = *s++;
+ if (((*src) & 0x80) == '\0') {
+ *dst++ = *src++;
--size;
} else {
if (size > 4) {
- sprintf(buf, "\\%03o",
- *(unsigned char *)s);
+ sprintf(dst, "\\%03o",
+ *(unsigned char *)src);
size -= 4;
- buf += 4;
- s++;
+ dst += 4;
+ src++;
} else {
/* Buffer full. */
- *buf = '\0'; /* XXX */
+ *dst = '\0'; /* XXX */
return r;
}
}
}
}
- *buf = '\0'; /* XXX */
+ *dst = '\0'; /* XXX */
return r;
}
diff --git a/lib/dpkg/path.h b/lib/dpkg/path.h
index 5be6078..5eb069b 100644
--- a/lib/dpkg/path.h
+++ b/lib/dpkg/path.h
@@ -32,7 +32,7 @@ DPKG_BEGIN_DECLS
size_t path_rtrim_slash_slashdot(char *path);
const char *path_skip_slash_dotslash(const char *path);
-char *path_quote_filename(char *buf, size_t size, const char *s);
+char *path_quote_filename(char *dst, const char *src, size_t size);
DPKG_END_DECLS
diff --git a/src/archives.c b/src/archives.c
index 41d3f07..48221a7 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -201,7 +201,7 @@ tarfile_skip_one_forward(struct TarInfo *ti,
fd_null_copy(tc->backendpipe, ti->Size,
_("skipped unpacking file '%.255s' (replaced or excluded?)"),
- path_quote_filename(fnamebuf, 256, ti->Name));
+ path_quote_filename(fnamebuf, ti->Name, 256));
r = ti->Size % TARBLKSZ;
if (r > 0)
r = safe_read(tc->backendpipe, databuf, TARBLKSZ - r);
@@ -639,7 +639,7 @@ int tarobject(struct TarInfo *ti) {
{ char fnamebuf[256];
fd_fd_copy(tc->backendpipe, fd, ti->Size,
_("backend dpkg-deb during `%.255s'"),
- path_quote_filename(fnamebuf, 256, ti->Name));
+ path_quote_filename(fnamebuf, ti->Name, 256));
}
r= ti->Size % TARBLKSZ;
if (r > 0) r= safe_read(tc->backendpipe,databuf,TARBLKSZ - r);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]