emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/beardbolt 743f9a68ec 158/323: Handle non absolute .file


From: ELPA Syncer
Subject: [elpa] externals/beardbolt 743f9a68ec 158/323: Handle non absolute .file paths
Date: Thu, 9 Mar 2023 10:58:27 -0500 (EST)

branch: externals/beardbolt
commit 743f9a68ec43f3d21fb3107153feefc377d80da3
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>

    Handle non absolute .file paths
    
    If we get a non-absolute .file path, treat it as if we are comparing
    in the directory of the source file. This should only make a
    difference for d, and may break other behavior in that case.
    
    Please report a bug if you encounter such behavior.
---
 rmsbolt.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index e87f47368b..fd85aa5b42 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -929,10 +929,12 @@ Argument SRC-BUFFER source buffer."
             '("Aborting processing due to exceeding the binary limit.")))
         (when (string-match rmsbolt-disass-line line)
           ;; Don't add linums from files which we aren't inspecting
-          (if (file-equal-p src-file-name
-                            (match-string 1 line))
-              (setq source-linum (string-to-number (match-string 2 line)))
-            (setq source-linum nil))
+          ;; If we get a non-absolute .file path, treat it like we are in the 
src directory.
+          (let ((default-directory (file-name-directory src-file-name)))
+            (if (file-equal-p src-file-name
+                              (match-string 1 line))
+                (setq source-linum (string-to-number (match-string 2 line)))
+              (setq source-linum nil)))
           ;; We are just setting a linum, no data here.
           (throw 'continue t))
 
@@ -984,12 +986,14 @@ Argument SRC-BUFFER source buffer."
            ;; Process any line number hints
            ((string-match rmsbolt-source-tag line)
             (if (or (not src-file-name) ;; Skip file match if we don't have a 
current filename
-                    (file-equal-p src-file-name
-                                  (gethash
-                                   (string-to-number (match-string 1 line))
-                                   source-file-map
-                                   ;; Assume we never will compile dev null :P
-                                   "/dev/null")))
+                    ;; If we get a non-absolute .file path, treat it like we 
are in the src directory.
+                    (let ((default-directory (file-name-directory 
src-file-name)))
+                      (file-equal-p src-file-name
+                                    (gethash
+                                     (string-to-number (match-string 1 line))
+                                     source-file-map
+                                     ;; Assume we never will compile dev null 
:P
+                                     "/dev/null"))))
                 (setq source-linum (string-to-number
                                     (match-string 2 line)))
               (setq source-linum nil)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]