summaryrefslogtreecommitdiff
path: root/source/a/ncompress/ncompress.zerobyteforce.diff
blob: 465d67e3e482b46257ecbfe612f9402c2f5978cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- ncompress-4.2.4/compress42.c.zerobyteforce	2006-04-14 14:18:28.000000000 +0200
+++ ncompress-4.2.4/compress42.c	2006-04-14 14:20:15.000000000 +0200
@@ -1145,10 +1145,12 @@
 			if (fdout != 1 && close(fdout))
 				write_error();
 
-			if (bytes_in == 0)
+			if ( (bytes_in == 0) && (force == 0 ) )
 			{
 				if (remove_ofname)
 				{
+					if(!quiet)
+						fprintf(stderr, "No compression -- %s unchanged\n", ifname);
 					if (unlink(ofname))	/* Remove input file */
 					{
 						fprintf(stderr, "\nunlink error (ignored) ");
@@ -1157,6 +1159,7 @@
 					}
 		
 					remove_ofname = 0;
+					exit_code = 2;
 				}
 			}
 			else