Description: <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.
 .
 maxima (5.37.1-1) unstable; urgency=medium
 .
   * New upstream release
   * Bug fix: "looking for info documentation in the wrong location",
     thanks to Antonio Terceiro (Closes: #788430).
Author: Camm Maguire <camm@debian.org>
Bug-Debian: https://bugs.debian.org/788430

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- maxima-5.37.1.orig/src/cl-info.lisp
+++ maxima-5.37.1/src/cl-info.lisp
@@ -211,7 +211,17 @@
 
 ; --------------- build help topic indices ---------------
 
-(defun load-info-hashtables (dir-name deffn-defvr-pairs section-pairs)
+(defun coerce-to-dirlist (pn)
+  (list (pathname-device pn) (append (pathname-directory pn) (list (concatenate 'string (pathname-name pn) (pathname-type pn))))))
+
+(defun valid-dirlist-p (dn)
+  (probe-file (make-pathname :device (car dn) :directory (cadr dn) :name "maxima" :type "info")))
+  
+(defun load-info-hashtables (dir-name deffn-defvr-pairs section-pairs
+				      ;; In Debian, lsp index file must be in different directory from info files
+				      &aux (dir-name (or (car (member-if 'valid-dirlist-p
+									 (list dir-name (coerce-to-dirlist maxima::*maxima-infodir*))))
+							 dir-name)))
   (if (and (zerop (length section-pairs)) 
            (zerop (length deffn-defvr-pairs)))
     (format t (intl:gettext "warning: ignoring an empty documentation index in ~a~%") dir-name)
