Anonymous avatar Anonymous committed 7246ed4

\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>;

Comments (0)

Files changed (5)

 			store.value_regex = (regex_t*)malloc(sizeof(regex_t));
 			if (regcomp(store.value_regex, value_regex,
 					REG_EXTENDED)) {
-				fprintf(stderr, "Invalid pattern: %s",
+				fprintf(stderr, "Invalid pattern: %s\n",
 					value_regex);
 				free(store.value_regex);
 				return 6;
 	if (*exec_path != '/') {
 		if (!getcwd(git_command, sizeof(git_command))) {
 			fprintf(stderr,
-				"git: cannot determine current directory");
+				"git: cannot determine current directory\n");
 			exit(1);
 		}
 		len = strlen(git_command);
 	case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
 		die("waitpid is confused");
 	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;
 	case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
 		die("%s died strangely", update_hook);
 	unlink(tmpfile);
 	if (ret) {
 		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;
 		}
 		/* FIXME!!! Collision check here ? */
 	}
 
 	if (errno != ENOENT) {
-		fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno));
+		fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
 		return -1;
 	}
 
 
 	fd = mkstemp(tmpfile);
 	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;
 	}
 
 		size = write(fd, buf + posn, objsize - posn);
 		if (size <= 0) {
 			if (!size) {
-				fprintf(stderr, "write closed");
+				fprintf(stderr, "write closed\n");
 			} else {
 				perror("write ");
 			}
 		return 0;
 	if (MAX_REVS <= ref_name_cnt) {
 		fprintf(stderr, "warning: ignoring %s; "
-			"cannot handle more than %d refs",
+			"cannot handle more than %d refs\n",
 			refname, MAX_REVS);
 		return 0;
 	}
 		if (MAX_REVS <= num_rev)
 			die("cannot handle more than %d revs.", MAX_REVS);
 		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);
 		if (!commit)
 			die("cannot find commit %s (%s)",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.