summaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-22 05:06:05 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-22 05:06:05 -0300
commit744cace90da595ab0dc98f65ed053968e07ef2c6 (patch)
tree3ebcc5862b51a34bbde2dc45eca757140b8fec4f /file
parentf4c830911621fca111a28ffc735a11b330975adf (diff)
downloadeeshow-744cace90da595ab0dc98f65ed053968e07ef2c6.tar.gz
eeshow-744cace90da595ab0dc98f65ed053968e07ef2c6.tar.bz2
eeshow-744cace90da595ab0dc98f65ed053968e07ef2c6.zip
eeshow/diag.c (progress): don't require user to supply newline
Diffstat (limited to 'file')
-rw-r--r--file/file.c10
-rw-r--r--file/git-file.c26
-rw-r--r--file/git-hist.c2
3 files changed, 19 insertions, 19 deletions
diff --git a/file/file.c b/file/file.c
index d41d053..274d88f 100644
--- a/file/file.c
+++ b/file/file.c
@@ -89,7 +89,7 @@ static bool try_related(struct file *file)
return 0;
}
- progress(1, "reading %s\n", tmp);
+ progress(1, "reading %s", tmp);
free((char *) file->name);
file->name = tmp;
@@ -138,14 +138,14 @@ static void *open_vcs(struct file *file)
free(tmp);
return file->vcs;
}
- progress(2, "could not open %s:%s\n", tmp, colon + 1);
+ progress(2, "could not open %s:%s", tmp, colon + 1);
return NULL;
} else {
file->vcs = vcs_git_open(NULL, file->name,
file->related ? file->related->vcs : NULL);
if (file->vcs)
return file->vcs;
- progress(2, "could not open %s\n", file->name);
+ progress(2, "could not open %s", file->name);
return NULL;
}
}
@@ -174,7 +174,7 @@ bool file_open(struct file *file, const char *name, const struct file *related)
file->file = fopen(name, "r");
if (file->file) {
- progress(1, "reading %s\n", name);
+ progress(1, "reading %s", name);
return 1;
}
@@ -211,7 +211,7 @@ bool file_open_revision(struct file *file, const char *rev, const char *name,
file->vcs = vcs_git_open(rev, name, related ? related->vcs : NULL);
if (file->vcs)
return 1;
- progress(2, "could not open %s at %s\n", name, rev);
+ progress(2, "could not open %s at %s", name, rev);
return 0;
}
diff --git a/file/git-file.c b/file/git-file.c
index 681556b..1b11a1b 100644
--- a/file/git-file.c
+++ b/file/git-file.c
@@ -76,7 +76,7 @@ static git_repository *select_repo(const char *path)
* So we trim off elements until we find a repository.
*/
while (1) {
- progress(3, "trying \"%s\"\n", tmp);
+ progress(3, "trying \"%s\"", tmp);
if (!git_repository_open_ext(&repo, *tmp ? tmp : "/",
GIT_REPOSITORY_OPEN_CROSS_FS, NULL))
break;
@@ -155,7 +155,7 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
end = tail = strchr(tmp, 0);
while (1) {
- progress(3, "probing \"%s\" tail \"%s\"\n", tmp, tail);
+ progress(3, "probing \"%s\" tail \"%s\"", tmp, tail);
if (stat(tmp, &path_st) == 0)
break;
if (!tmp[1])
@@ -169,7 +169,7 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
/* remove . and .. from tail */
- progress(3, "input tail \"%s\"\n", tail);
+ progress(3, "input tail \"%s\"", tail);
from = to = tail;
while (1) {
if (!strncmp(from, "./", 2)) {
@@ -207,12 +207,12 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
to--;
}
*to = 0;
- progress(3, "output tail \"%s\"\n", tail);
+ progress(3, "output tail \"%s\"", tail);
/* resolve all symlinks */
real = realpath(tmp, NULL);
- progress(3, "realpath(\"%s\") = \"%s\"\n", tmp, real);
+ progress(3, "realpath(\"%s\") = \"%s\"", tmp, real);
/* append tail */
@@ -226,13 +226,13 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
free(tmp);
tmp = tmp2;
- progress(2, "full object path \"%s\"\n", tmp);
+ progress(2, "full object path \"%s\"", tmp);
/* find which part of our path is inside the repo */
end = tail = strchr(tmp, 0);
while (1) {
- progress(3, "trying \"%s\" tail \"%s\"\n", tmp, tail);
+ progress(3, "trying \"%s\" tail \"%s\"", tmp, tail);
if (stat(tmp, &path_st) == 0 &&
path_st.st_dev == repo_st.st_dev &&
@@ -252,7 +252,7 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
*slash = 0;
}
- progress(2, "path in repo \"%s\"\n", tail);
+ progress(2, "path in repo \"%s\"", tail);
tmp2 = stralloc(tail);
free(tmp);
@@ -278,7 +278,7 @@ static git_tree_entry *find_file(git_repository *repo, git_tree *tree,
if (len >= 5 && !strcmp(repo_path + len - 5, "/.git"))
repo_path[len == 5 ? 1 : len - 5] = 0;
- progress(2, "repo dir \"%s\"\n", repo_path);
+ progress(2, "repo dir \"%s\"", repo_path);
canon_path = canonical_path_into_repo(repo_path, path);
free(repo_path);
@@ -320,7 +320,7 @@ static const void *get_data(struct vcs_git *vcs_git, git_tree_entry *entry,
fatal("%s\n", e->message);
}
- progress(3, "object %s\n", buf.ptr);
+ progress(3, "object %s", buf.ptr);
git_buf_free(&buf);
}
blob = (git_blob *) obj;
@@ -351,7 +351,7 @@ static bool access_file_data(struct vcs_git *vcs_git, const char *name)
entry = find_file(vcs_git->repo, vcs_git->tree, name);
if (!entry)
return 0;
- progress(1, "reading %s\n", name);
+ progress(1, "reading %s", name);
vcs_git->data = get_data(vcs_git, entry, &vcs_git->size);
return 1;
@@ -386,7 +386,7 @@ static bool related_only_repo(struct vcs_git *vcs_git)
const struct vcs_git *related = vcs_git->related;
char *tmp;
- progress(2, "trying graft \"%s\" \"%s\"\n",
+ progress(2, "trying graft \"%s\" \"%s\"",
related->name, vcs_git->name);
tmp = file_graft_relative(related->name, vcs_git->name);
if (!tmp)
@@ -446,7 +446,7 @@ struct vcs_git *vcs_git_open(const char *revision, const char *name,
error("%s: not found", name);
goto fail;
}
- progress(2, "using repository %s\n",
+ progress(2, "using repository %s",
git_repository_path(vcs_git->repo));
if (!revision)
diff --git a/file/git-hist.c b/file/git-hist.c
index a06ac12..308d76c 100644
--- a/file/git-hist.c
+++ b/file/git-hist.c
@@ -85,7 +85,7 @@ static void recurse(struct hist *h,
n = git_commit_parentcount(h->commit);
if (verbose > 2)
- progress(3, "commit %p: %u + %u\n", h->commit, n_branches, n);
+ progress(3, "commit %p: %u + %u", h->commit, n_branches, n);
b = alloca(sizeof(struct hist) * (n_branches - 1 + n));
n_branches--;