aboutsummaryrefslogtreecommitdiff
path: root/trees.c
diff options
context:
space:
mode:
Diffstat (limited to 'trees.c')
-rw-r--r--trees.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/trees.c b/trees.c
index decaeb7..6896067 100644
--- a/trees.c
+++ b/trees.c
@@ -1091,9 +1091,9 @@ local void compress_block(s, ltree, dtree)
1091 * Check if the data type is TEXT or BINARY, using the following algorithm: 1091 * Check if the data type is TEXT or BINARY, using the following algorithm:
1092 * - TEXT if the two conditions below are satisfied: 1092 * - TEXT if the two conditions below are satisfied:
1093 * a) There are no non-portable control characters belonging to the 1093 * a) There are no non-portable control characters belonging to the
1094 * "black list" (0..6, 14..25, 28..31). 1094 * "block list" (0..6, 14..25, 28..31).
1095 * b) There is at least one printable character belonging to the 1095 * b) There is at least one printable character belonging to the
1096 * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). 1096 * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
1097 * - BINARY otherwise. 1097 * - BINARY otherwise.
1098 * - The following partially-portable control characters form a 1098 * - The following partially-portable control characters form a
1099 * "gray list" that is ignored in this detection algorithm: 1099 * "gray list" that is ignored in this detection algorithm:
@@ -1103,19 +1103,19 @@ local void compress_block(s, ltree, dtree)
1103local int detect_data_type(s) 1103local int detect_data_type(s)
1104 deflate_state *s; 1104 deflate_state *s;
1105{ 1105{
1106 /* black_mask is the bit mask of black-listed bytes 1106 /* block_mask is the bit mask of block-listed bytes
1107 * set bits 0..6, 14..25, and 28..31 1107 * set bits 0..6, 14..25, and 28..31
1108 * 0xf3ffc07f = binary 11110011111111111100000001111111 1108 * 0xf3ffc07f = binary 11110011111111111100000001111111
1109 */ 1109 */
1110 unsigned long black_mask = 0xf3ffc07fUL; 1110 unsigned long block_mask = 0xf3ffc07fUL;
1111 int n; 1111 int n;
1112 1112
1113 /* Check for non-textual ("black-listed") bytes. */ 1113 /* Check for non-textual ("block-listed") bytes. */
1114 for (n = 0; n <= 31; n++, black_mask >>= 1) 1114 for (n = 0; n <= 31; n++, block_mask >>= 1)
1115 if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) 1115 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
1116 return Z_BINARY; 1116 return Z_BINARY;
1117 1117
1118 /* Check for textual ("white-listed") bytes. */ 1118 /* Check for textual ("allow-listed") bytes. */
1119 if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 1119 if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
1120 || s->dyn_ltree[13].Freq != 0) 1120 || s->dyn_ltree[13].Freq != 0)
1121 return Z_TEXT; 1121 return Z_TEXT;
@@ -1123,7 +1123,7 @@ local int detect_data_type(s)
1123 if (s->dyn_ltree[n].Freq != 0) 1123 if (s->dyn_ltree[n].Freq != 0)
1124 return Z_TEXT; 1124 return Z_TEXT;
1125 1125
1126 /* There are no "black-listed" or "white-listed" bytes: 1126 /* There are no "block-listed" or "allow-listed" bytes:
1127 * this stream either is empty or has tolerated ("gray-listed") bytes only. 1127 * this stream either is empty or has tolerated ("gray-listed") bytes only.
1128 */ 1128 */
1129 return Z_BINARY; 1129 return Z_BINARY;