bug-groff
[Top][All Lists]
Advanced

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

[bug #61206] [pic] causes stale input filename to get cached


From: G. Branden Robinson
Subject: [bug #61206] [pic] causes stale input filename to get cached
Date: Tue, 28 Sep 2021 02:42:05 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #61206 (project groff):

                  Status:             In Progress => Fixed                  
             Open/Closed:                    Open => Closed                 
         Planned Release:                    None => 1.23.0                 

    _______________________________________________________

Follow-up Comment #2:


commit 423e3c0b45a59c5476a2adc95bd38426a40456f3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 28 16:05:36 2021 +1000

    [pic]: Update input file name correctly.
    
    * src/preproc/pic/troff.cpp (troff_output::set_location): Copy the
      inbound file name argument with `strdup()` and store pointer to this
      copy in `last_filename` instead of aliasing argument.
    
      (troff_output::~troff_output): `free()` the memory allocated by
      `strdup()` in destructor.
    
    Fixes <https://savannah.gnu.org/bugs/?61206>.  Pointer assignment
    instead of a string copy was being performed, which means that after its
    initial assignment, `last_filename` always shared its value ultimately
    with the `current_filename` pointer (a libgroff symbol), so `strcmp()`
    was always being performed on identical pointers.  Problem appears to
    date back 30+ years, to the dawn of our repo history.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61206>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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