bugGNU roff - Bugs: bug #66027, [soelim] stop requiring spaces to...

 
 

bug #66027: [soelim] stop requiring spaces to be backslash-escaped, and strip leading double quote

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 26 Jul 2024 03:48:54 AM UTC
   
 
Category:  Preprocessor soelim Severity:  1 - Wish
Item Group:  Feature change Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Nov 2024 05:02:14 PM UTC, comment #3: 


commit f539e5df1dbb3a65b49302c5f8145604b4b02ef0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Nov 12 10:26:07 2024 -0600

    [soelim]: Fix Savannah #66027.

    Read argument to `so` request in a more GNU troff-ish fashion (and a
    more AT&T troff-ish fasion, if one considers the `ds` and `as`
    requests).  Accept but discard a leading double quote to permit
    embedding of leading spaces in the file name, and accept unescaped
    literal spaces in argument.

    * src/preproc/soelim/soelim.cpp (do_so): Do it.
    * src/preproc/soelim/soelim.1.man (Description): Document it.

    * src/preproc/soelim/tests/space-in-argument-works.sh: Add unit test.
    * src/preproc/soelim/soelim.am (soelim_TESTS): Run test.

    * NEWS: Add item.

    Fixes <https://savannah.gnu.org/bugs/?66027>.


G. Branden Robinson <gbranden>
Group administrator
Tue 12 Nov 2024 04:19:09 PM UTC, comment #2: 

Er, it's a one liner to handle the unescaped space.

G. Branden Robinson <gbranden>
Group administrator
Tue 12 Nov 2024 04:18:25 PM UTC, comment #1: 

This is a one-liner.


diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index e10447d06..18f37870f 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -141,7 +141,7 @@ void do_so(const char *line)
   string filename;
   bool is_filename_valid = true;
   for (const char *q = p;
-       is_filename_valid && *q != '\0' && *q != '\n' && *q != ' ';
+       is_filename_valid && *q != '\0' && *q != '\n';
        q++)
     if (*q == '\\') {
       switch (*++q) {


G. Branden Robinson <gbranden>
Group administrator
Fri 26 Jul 2024 03:48:54 AM UTC, original submission:  

I propose permitting `soelim` to interpret spaces in a `so` argument as-is, and supporting `ds`-style leading double-quote removal (allowing file names that begin with spaces).

Why?

To align with a proposed syntax extension to `so` and other requests in the formatter.  See bug #65108.

Won't this break compatibility with everybody?

No.  Historically, neither formatters nor soelim programs don't interpret backslash-escaped spaces as spaces, and in fact soelim programs traditionally rewrite the first space they encounter in a `so` argument as a newline (likely putting an undesired partial file name on the output as formatted text).

See comments 3 and 4 to bug #65108.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-14 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2024-11-12 gbranden Dependencies- bugs #65099 is dependent
    2024-11-12 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2024-07-26 gbranden Dependencies- Depends on bugs #65108

    Back to the top

    Powered by Savane 3.14-9aa3.
    Corresponding source code