+2007-07-31 Ian Jackson <iwj@ubuntu.com>
+
+ * src/archives.c (quote_filename): Change formatting to match the
+ rest of the file (tab -> 2 spaces).
+
2007-07-25 Guillem Jover <guillem@debian.org>
* scripts/changelog/debian.pl: Switch from 'dpkg-gettext.pl' to
static char *
quote_filename(char *buf, int size, char *s)
{
- char *r = buf;
- while (size > 0) {
- switch (*s) {
- case '\0':
- *buf = '\0';
- return r;
- case '\\':
- *buf++ = '\\';
- *buf++ = '\\';
- size -= 2;
- break;
- default:
- if (((*s)&0x80) == 0) {
- *buf++ = *s++;
- --size;
- } else {
- if (size > 4) {
- sprintf(buf, "\\%03o",
- *(unsigned char *)s);
- size -= 4;
- buf += 4;
- s++;
- } else {
- /* buffer full */
- *buf = '\0'; /* XXX */
- return r;
- }
- }
- }
- }
- *buf = '\0'; /* XXX */
- return r;
+ char *r = buf;
+ while (size > 0) {
+ switch (*s) {
+ case '\0':
+ *buf = '\0';
+ return r;
+ case '\\':
+ *buf++ = '\\';
+ *buf++ = '\\';
+ size -= 2;
+ break;
+ default:
+ if (((*s) & 0x80) == 0) {
+ *buf++ = *s++;
+ --size;
+ } else {
+ if (size > 4) {
+ sprintf(buf, "\\%03o", *(unsigned char *)s);
+ size -= 4;
+ buf += 4;
+ s++;
+ } else {
+ /* buffer full */
+ *buf = '\0'; /* XXX */
+ return r;
+ }
+ }
+ }
+ }
+ *buf = '\0'; /* XXX */
+
+ return r;
}
/* special routine to handle partial reads from the tarfile */