summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22943f1)
raw | patch | inline | side by side (parent: 22943f1)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 15 Oct 2005 04:56:46 +0000 (21:56 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 18 Oct 2005 00:41:55 +0000 (17:41 -0700) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
ls-files.c | patch | blob | history | |
ls-tree.c | patch | blob | history |
diff --git a/ls-files.c b/ls-files.c
index f47114a168f3a7479cbe147f953e5f56af3d2dfc..3085b2fc8c7e8920ecca8e9c0657d6124b0fbfda 100644 (file)
--- a/ls-files.c
+++ b/ls-files.c
#include <fnmatch.h>
#include "cache.h"
+#include "quote.h"
static int show_deleted = 0;
static int show_cached = 0;
if (pathspec && !match(pathspec, ent->name, len))
return;
- printf("%s%s%c", tag, ent->name + offset, line_terminator);
+ fputs(tag, stdout);
+ write_name_quoted("", ent->name + offset, line_terminator, stdout);
+ putchar(line_terminator);
}
static void show_killed_files(void)
if (pathspec && !match(pathspec, ce->name, len))
return;
- if (!show_stage)
- printf("%s%s%c", tag, ce->name + offset, line_terminator);
- else
- printf("%s%06o %s %d\t%s%c",
+ if (!show_stage) {
+ fputs(tag, stdout);
+ write_name_quoted("", ce->name + offset, line_terminator, stdout);
+ putchar(line_terminator);
+ }
+ else {
+ printf("%s%06o %s %d\t",
tag,
ntohl(ce->ce_mode),
sha1_to_hex(ce->sha1),
- ce_stage(ce),
- ce->name + offset, line_terminator);
+ ce_stage(ce));
+ write_name_quoted("", ce->name + offset, line_terminator, stdout);
+ putchar(line_terminator);
+ }
}
static void show_files(void)
diff --git a/ls-tree.c b/ls-tree.c
index dd642e0bf059cdf969d370fc1155fb189a0c89ce..d9f15e349cb833401eea38d21fb050b10f9678d4 100644 (file)
--- a/ls-tree.c
+++ b/ls-tree.c
#include "cache.h"
#include "blob.h"
#include "tree.h"
+#include "quote.h"
static int line_termination = '\n';
#define LS_RECURSIVE 1
int err = 0;
if (e != &root_entry) {
- printf("%06o %s %s %s%s", e->mode, entry_type(e),
- entry_hex(e), pathbuf, e->name);
+ printf("%06o %s %s ",
+ e->mode, entry_type(e), entry_hex(e));
+ write_name_quoted(pathbuf, e->name, line_termination, stdout);
putchar(line_termination);
}