فهرست منبع

unbreak vwarn: print ": " before errno message

patch by Strake. this seems to be a regression caused by fixing the
behavior of perror("") to match perror(0) at some point in the past.
Rich Felker 11 سال پیش
والد
کامیت
580b8d8c52
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      src/legacy/err.c

+ 5 - 2
src/legacy/err.c

@@ -8,8 +8,11 @@ extern char *__progname;
 void vwarn(const char *fmt, va_list ap)
 {
 	fprintf (stderr, "%s: ", __progname);
-	if (fmt) vfprintf(stderr, fmt, ap);
-	perror("");
+	if (fmt) {
+		vfprintf(stderr, fmt, ap);
+		fputs (": ", stderr);
+	}
+	perror(0);
 }
 
 void vwarnx(const char *fmt, va_list ap)