File: fix-restrict-filename.patch

package info (click to toggle)
wget2 2.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,248 kB
  • sloc: ansic: 121,144; sh: 11,559; makefile: 878; xml: 182; sed: 16
file content (18 lines) | stat: -rw-r--r-- 643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: Fix wget_restrict_file_name
 It fails to work as expected on architectures where char is unsigned by default.
Author: Shengqi Chen <harry@debian.org>
Bug: https://gitlab.com/gnuwget/wget2/-/issues/694
Last-Update: 2025-03-02 
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/utils.c
+++ b/src/utils.c
@@ -151,7 +151,7 @@
 	bool ascii = mode & WGET_RESTRICT_NAMES_ASCII;
 
 	for (dst = esc, s = fname; *s; s++) {
-		char c = *s;
+		signed char c = *s;
 
 		if (lowercase && c >= 'A' && c <= 'Z') { // isupper() also returns true for chars > 0x7f, the test is not EBCDIC compatible ;-)
 			c |= 0x20;