\n usage in stderr output
fprintf and die sometimes have missing/excessive "\n" in their arguments, correct the strings where I think it would be appropriate. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen committed
Dec 15, 2005 at 08:47 UTC
7246ed438c541650c2cd50e4e98b43226f60da0c
5 files changed
+9
-9
config.c
+1
-1
@@ -487,7 +487,7 @@ int git_config_set_multivar(const char* key, const char* value,
487
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
488
if (regcomp(store.value_regex, value_regex,
489
REG_EXTENDED)) {
490
- fprintf(stderr, "Invalid pattern: %s",
490
+ fprintf(stderr, "Invalid pattern: %s\n",
491
value_regex);
492
free(store.value_regex);
493
return 6;
git.c
+1
-1
@@ -278,7 +278,7 @@ int main(int argc, char **argv, char **envp)
278
if (*exec_path != '/') {
279
if (!getcwd(git_command, sizeof(git_command))) {
280
fprintf(stderr,
281
- "git: cannot determine current directory");
281
+ "git: cannot determine current directory\n");
282
exit(1);
283
}
284
len = strlen(git_command);
receive-pack.c
+1
-1
@@ -79,7 +79,7 @@ static int run_update_hook(const char *refname,
79
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
80
die("waitpid is confused");
81
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
82
- fprintf(stderr, "%s died of signal", update_hook);
82
+ fprintf(stderr, "%s died of signal\n", update_hook);
83
return -1;
84
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
85
die("%s died strangely", update_hook);
sha1_file.c
+4
-4
@@ -1274,7 +1274,7 @@ int move_temp_to_file(const char *tmpfile, char *filename)
1274
unlink(tmpfile);
1275
if (ret) {
1276
if (ret != EEXIST) {
1277
- fprintf(stderr, "unable to write sha1 filename %s: %s", filename, strerror(ret));
1277
+ fprintf(stderr, "unable to write sha1 filename %s: %s\n", filename, strerror(ret));
1278
return -1;
1279
}
1280
/* FIXME!!! Collision check here ? */
@@ -1313,7 +1313,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
1313
}
1314
1315
if (errno != ENOENT) {
1316
- fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno));
1316
+ fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
1317
return -1;
1318
}
1319
@@ -1321,7 +1321,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
1321
1322
fd = mkstemp(tmpfile);
1323
if (fd < 0) {
1324
- fprintf(stderr, "unable to create temporary sha1 filename %s: %s", tmpfile, strerror(errno));
1324
+ fprintf(stderr, "unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
1325
return -1;
1326
}
1327
@@ -1410,7 +1410,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
1410
size = write(fd, buf + posn, objsize - posn);
1411
if (size <= 0) {
1412
if (!size) {
1413
- fprintf(stderr, "write closed");
1413
+ fprintf(stderr, "write closed\n");
1414
} else {
1415
perror("write ");
1416
}
show-branch.c
+2
-2
@@ -303,7 +303,7 @@ static int append_ref(const char *refname, const unsigned char *sha1)
303
return 0;
304
if (MAX_REVS <= ref_name_cnt) {
305
fprintf(stderr, "warning: ignoring %s; "
306
- "cannot handle more than %d refs",
306
+ "cannot handle more than %d refs\n",
307
refname, MAX_REVS);
308
return 0;
309
}
@@ -537,7 +537,7 @@ int main(int ac, char **av)
537
if (MAX_REVS <= num_rev)
538
die("cannot handle more than %d revs.", MAX_REVS);
539
if (get_sha1(ref_name[num_rev], revkey))
540
- die("'%s' is not a valid ref.\n", ref_name[num_rev]);
540
+ die("'%s' is not a valid ref.", ref_name[num_rev]);
541
commit = lookup_commit_reference(revkey);
542
if (!commit)
543
die("cannot find commit %s (%s)",