From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Camm Maguire <camm@debian.org>
Date: Feb, 26 2026 16:58:56 +0000
Subject: [PATCH] <short summary of the patch>

TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.

Bug-Debian: https://bugs.debian.org/1108096
Bug-Debian: https://bugs.debian.org/1118704
Bug-Debian: https://bugs.debian.org/1122744
Bug-Debian: https://bugs.debian.org/1128546
Bug-Debian: https://bugs.debian.org/1128663
---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-<Vendor>: <vendor-bugtracker-url>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>

--- gcl27-2.7.1.orig/ansi-tests/read-byte.lsp
+++ gcl27-2.7.1/ansi-tests/read-byte.lsp
@@ -96,7 +96,9 @@
      (let ((s (open "foo.txt"
 		   :direction :input
 		   :element-type '(unsigned-byte 8))))
-       (read-byte s))
+       (unwind-protect
+	   (read-byte s)
+	 (close s)))
      end-of-file))
   t)
 
--- gcl27-2.7.1.orig/git.tag
+++ gcl27-2.7.1/git.tag
@@ -1,2 +1 @@
-"Version_2_7_2pre10"
-
+"Version_2_7_2pre11"
--- gcl27-2.7.1.orig/h/protoize.h
+++ gcl27-2.7.1/h/protoize.h
@@ -73,7 +73,6 @@ struct key {short n,allow_other_keys;
 /* bind.c:975:OF */ extern void set_key_struct (struct key *ks, object data); /* (ks, data) struct key *ks; object data; */
 /* bind.c:995:OF */ extern void gcl_init_bind (void); /* () */
 /* block.c:121:OF */ extern void gcl_init_block (void); /* () */
-/* bsearch.c:5:OF */ extern void *bsearch (const void *key, const void *base, size_t nel, size_t keysize, int (*compar) (const void *,const void *)); /* (key, base, nel, keysize, compar) char *key; char *base; unsigned int nel; unsigned int keysize; int (*compar)(); */
 #if defined (__MINGW32__)
 /* bzero.c:3:OF */ /*  extern void bzero (char *b, size_t length); */ /* (b, length) char *b; int length; */
 #endif
--- gcl27-2.7.1.orig/lsp/gcl_make_pathname.lsp
+++ gcl27-2.7.1/lsp/gcl_make_pathname.lsp
@@ -43,7 +43,7 @@
 						  (string-concatenate "(" (substitute #\^ #\! (subseq x 0 2)) (subseq x 2) ")")))
 					  (cons #v"\\*" (lambda (x y) (declare (ignore x)) (if (plusp (length y)) (string-concatenate "([^" y "]*)") "(.*)")))
 					  (cons #v"\\?" (lambda (x y) (declare (ignore x)) (if (plusp (length y)) (string-concatenate "([^" y "])") "(.)")))
-					  (cons #v"\\." (lambda (x y) (declare (ignore x y))"\\."))))
+					  (cons #v"[+|.^$()]" (lambda (x y) (declare (ignore x y))(string-concatenate "\\" x)))))
 
 (defconstant +physical-pathname-defaults+ '(("" "" "" "")
 					    ("" "" "" "")
--- gcl27-2.7.1.orig/lsp/gcl_truename.lsp
+++ gcl27-2.7.1/lsp/gcl_truename.lsp
@@ -8,7 +8,13 @@
 	   (fr (set-fr fr (if (eql i -1) n i)))
 	   (l (when (eq (stat1 fr) :link) (readlinkat 0 fr))))
       (cond (l (let ((b (if (eql #\/ (aref l 0)) 0 b)))
-		 (link-expand (concatenate 'string (set-fr fr b) l (frame (if (eql i -1) n i) n)) b)))
+		 (link-expand (concatenate
+			       'string
+			       (set-fr fr b)
+			       (let ((ll (1- (length l))))
+				 (if (eql #\/ (aref l ll)) (subseq l 0 ll) l))
+			       (frame (if (eql i -1) n i) n))
+			      b)))
 	    ((eql i -1) str)
 	    ((link-expand str (1+ i) n fr))))))
 
