Give no terminating LF to error() function.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 22, 2006 at 17:47 UTC
bd2afde8a38b97391b22afebf15c583fb0fffacb
6 files changed
+15
-13
commit.c
+2
-1
@@ -212,7 +212,8 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
212
if (memcmp(bufptr, "tree ", 5))
213
return error("bogus commit object %s", sha1_to_hex(item->object.sha1));
214
if (get_sha1_hex(bufptr + 5, parent) < 0)
215
- return error("bad tree pointer in commit %s\n", sha1_to_hex(item->object.sha1));
215
+ return error("bad tree pointer in commit %s",
216
+ sha1_to_hex(item->object.sha1));
217
item->tree = lookup_tree(parent);
218
if (item->tree)
219
n_refs++;
http-fetch.c
+4
-4
@@ -130,7 +130,7 @@ static void start_object_request(struct object_request *obj_req)
130
131
if (obj_req->local < 0) {
132
obj_req->state = ABORTED;
133
- error("Couldn't create temporary file %s for %s: %s\n",
133
+ error("Couldn't create temporary file %s for %s: %s",
134
obj_req->tmpfile, obj_req->filename, strerror(errno));
135
return;
136
}
@@ -830,9 +830,9 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
830
obj_req->errorstr, obj_req->curl_result,
831
obj_req->http_code, hex);
832
} else if (obj_req->zret != Z_STREAM_END) {
833
- ret = error("File %s (%s) corrupt\n", hex, obj_req->url);
833
+ ret = error("File %s (%s) corrupt", hex, obj_req->url);
834
} else if (memcmp(obj_req->sha1, obj_req->real_sha1, 20)) {
835
- ret = error("File %s has bad hash\n", hex);
835
+ ret = error("File %s has bad hash", hex);
836
} else if (obj_req->rename < 0) {
837
ret = error("unable to write sha1 filename %s",
838
obj_req->filename);
@@ -854,7 +854,7 @@ int fetch(unsigned char *sha1)
854
fetch_alternates(alt->base);
855
altbase = altbase->next;
856
}
857
- return error("Unable to find %s under %s\n", sha1_to_hex(sha1),
857
+ return error("Unable to find %s under %s", sha1_to_hex(sha1),
858
alt->base);
859
}
860
read-tree.c
+2
-2
@@ -564,7 +564,7 @@ static int twoway_merge(struct cache_entry **src)
564
struct cache_entry *oldtree = src[1], *newtree = src[2];
565
566
if (merge_size != 2)
567
- return error("Cannot do a twoway merge of %d trees\n",
567
+ return error("Cannot do a twoway merge of %d trees",
568
merge_size);
569
570
if (current) {
@@ -616,7 +616,7 @@ static int oneway_merge(struct cache_entry **src)
616
struct cache_entry *a = src[1];
617
618
if (merge_size != 1)
619
- return error("Cannot do a oneway merge of %d trees\n",
619
+ return error("Cannot do a oneway merge of %d trees",
620
merge_size);
621
622
if (!a)
receive-pack.c
+2
-2
@@ -92,7 +92,7 @@ static int run_update_hook(const char *refname,
92
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
93
return error("waitpid is confused");
94
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
95
- return error("%s died of signal\n", update_hook);
95
+ return error("%s died of signal", update_hook);
96
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
97
return error("%s died strangely", update_hook);
98
default:
@@ -158,7 +158,7 @@ static int update(struct command *cmd)
158
if (run_update_hook(name, old_hex, new_hex)) {
159
unlink(lock_name);
160
cmd->error_string = "hook declined";
161
- return error("hook declined to update %s\n", name);
161
+ return error("hook declined to update %s", name);
162
}
163
else if (rename(lock_name, name) < 0) {
164
unlink(lock_name);
refs.c
+1
-1
@@ -268,7 +268,7 @@ static int write_ref_file(const char *filename,
268
char term = '\n';
269
if (write(fd, hex, 40) < 40 ||
270
write(fd, &term, 1) < 1) {
271
- error("Couldn't write %s\n", filename);
271
+ error("Couldn't write %s", filename);
272
close(fd);
273
return -1;
274
}
sha1_file.c
+4
-3
@@ -564,7 +564,7 @@ static void prepare_packed_git_one(char *objdir, int local)
564
dir = opendir(path);
565
if (!dir) {
566
if (errno != ENOENT)
567
- error("unable to open object pack directory: %s: %s\n",
567
+ error("unable to open object pack directory: %s: %s",
568
path, strerror(errno));
569
return;
570
}
@@ -1513,7 +1513,8 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
1513
1514
local = mkstemp(tmpfile);
1515
if (local < 0)
1516
- return error("Couldn't open %s for %s\n", tmpfile, sha1_to_hex(sha1));
1516
+ return error("Couldn't open %s for %s",
1517
+ tmpfile, sha1_to_hex(sha1));
1518
1519
memset(&stream, 0, sizeof(stream));
1520
@@ -1561,7 +1562,7 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
1562
}
1563
if (memcmp(sha1, real_sha1, 20)) {
1564
unlink(tmpfile);
1564
- return error("File %s has bad hash\n", sha1_to_hex(sha1));
1565
+ return error("File %s has bad hash", sha1_to_hex(sha1));
1566
}
1567
1568
return move_temp_to_file(tmpfile, sha1_file_name(sha1));