\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>
This commit is contained in:
Alex Riesen 2005-12-15 08:47:30 +01:00 committed by Junio C Hamano
parent f4a11066cf
commit 7246ed438c
5 changed files with 9 additions and 9 deletions

View File

@ -487,7 +487,7 @@ int git_config_set_multivar(const char* key, const char* value,
store.value_regex = (regex_t*)malloc(sizeof(regex_t)); store.value_regex = (regex_t*)malloc(sizeof(regex_t));
if (regcomp(store.value_regex, value_regex, if (regcomp(store.value_regex, value_regex,
REG_EXTENDED)) { REG_EXTENDED)) {
fprintf(stderr, "Invalid pattern: %s", fprintf(stderr, "Invalid pattern: %s\n",
value_regex); value_regex);
free(store.value_regex); free(store.value_regex);
return 6; return 6;

2
git.c
View File

@ -278,7 +278,7 @@ int main(int argc, char **argv, char **envp)
if (*exec_path != '/') { if (*exec_path != '/') {
if (!getcwd(git_command, sizeof(git_command))) { if (!getcwd(git_command, sizeof(git_command))) {
fprintf(stderr, fprintf(stderr,
"git: cannot determine current directory"); "git: cannot determine current directory\n");
exit(1); exit(1);
} }
len = strlen(git_command); len = strlen(git_command);

View File

@ -79,7 +79,7 @@ static int run_update_hook(const char *refname,
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID: case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
die("waitpid is confused"); die("waitpid is confused");
case -ERR_RUN_COMMAND_WAITPID_SIGNAL: case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
fprintf(stderr, "%s died of signal", update_hook); fprintf(stderr, "%s died of signal\n", update_hook);
return -1; return -1;
case -ERR_RUN_COMMAND_WAITPID_NOEXIT: case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
die("%s died strangely", update_hook); die("%s died strangely", update_hook);

View File

@ -1274,7 +1274,7 @@ int move_temp_to_file(const char *tmpfile, char *filename)
unlink(tmpfile); unlink(tmpfile);
if (ret) { if (ret) {
if (ret != EEXIST) { if (ret != EEXIST) {
fprintf(stderr, "unable to write sha1 filename %s: %s", filename, strerror(ret)); fprintf(stderr, "unable to write sha1 filename %s: %s\n", filename, strerror(ret));
return -1; return -1;
} }
/* FIXME!!! Collision check here ? */ /* FIXME!!! Collision check here ? */
@ -1313,7 +1313,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
} }
if (errno != ENOENT) { if (errno != ENOENT) {
fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno)); fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
return -1; return -1;
} }
@ -1321,7 +1321,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
fd = mkstemp(tmpfile); fd = mkstemp(tmpfile);
if (fd < 0) { if (fd < 0) {
fprintf(stderr, "unable to create temporary sha1 filename %s: %s", tmpfile, strerror(errno)); fprintf(stderr, "unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
return -1; return -1;
} }
@ -1410,7 +1410,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
size = write(fd, buf + posn, objsize - posn); size = write(fd, buf + posn, objsize - posn);
if (size <= 0) { if (size <= 0) {
if (!size) { if (!size) {
fprintf(stderr, "write closed"); fprintf(stderr, "write closed\n");
} else { } else {
perror("write "); perror("write ");
} }

View File

@ -303,7 +303,7 @@ static int append_ref(const char *refname, const unsigned char *sha1)
return 0; return 0;
if (MAX_REVS <= ref_name_cnt) { if (MAX_REVS <= ref_name_cnt) {
fprintf(stderr, "warning: ignoring %s; " fprintf(stderr, "warning: ignoring %s; "
"cannot handle more than %d refs", "cannot handle more than %d refs\n",
refname, MAX_REVS); refname, MAX_REVS);
return 0; return 0;
} }
@ -537,7 +537,7 @@ int main(int ac, char **av)
if (MAX_REVS <= num_rev) if (MAX_REVS <= num_rev)
die("cannot handle more than %d revs.", MAX_REVS); die("cannot handle more than %d revs.", MAX_REVS);
if (get_sha1(ref_name[num_rev], revkey)) if (get_sha1(ref_name[num_rev], revkey))
die("'%s' is not a valid ref.\n", ref_name[num_rev]); die("'%s' is not a valid ref.", ref_name[num_rev]);
commit = lookup_commit_reference(revkey); commit = lookup_commit_reference(revkey);
if (!commit) if (!commit)
die("cannot find commit %s (%s)", die("cannot find commit %s (%s)",