bugGNU nano - Bugs: bug #58799, older compilers do not understand...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58799: older compilers do not understand "\e"; use "\x1B" instead

Submitter:  Henry Bent <hbent>
Submitted:  Tue 21 Jul 2020 03:07:47 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 30 Jul 2020 07:17:54 AM UTC, comment #4: 

Released in nano-5.0.

Benno Schulenberg <bens>
Group administrator
Wed 22 Jul 2020 07:23:50 AM UTC, comment #3: 

Thanks for the reference, and for reporting.

Fixed in git, commit e59a0f5e.

Benno Schulenberg <bens>
Group administrator
Tue 21 Jul 2020 05:12:50 PM UTC, comment #2: 

Most recently I was using Sun Studio 11 on Solaris 8, but I've also hit this on Tru64 with the DEC C compiler (6.5) and on IRIX with MIPSpro.

\e is not standard anyway, and is not in C99; see http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf page 23.

Henry Bent <hbent>
Tue 21 Jul 2020 04:39:28 PM UTC, comment #1: 

Which old compiler are you using?  On which platform or distribution (and version) is it running?

Benno Schulenberg <bens>
Group administrator
Tue 21 Jul 2020 03:07:47 PM UTC, original submission:  

Many older C compilers don't understand \e, so please change it to \x1B for compatibility.  Trivial patch:

--- nano.c.orig 2020-05-23 11:01:56.000000000 +0000
+++ nano.c      2020-07-21 11:06:49.825906000 +0000
@@ -307,7 +307,7 @@
        curs_set(1);
        endwin();
 #ifndef NANO_TINY
-       printf("\e[?2004l");
+       printf("\x1B[?2004l");
        fflush(stdout);
 #endif
        tcsetattr(0, TCSANOW, &original_state);
@@ -1303,7 +1303,7 @@

 #ifndef NANO_TINY
        /* Tell the terminal to enable bracketed pastes. */
-       printf("\e[?2004h");
+       printf("\x1B[?2004h");
        fflush(stdout);
 #endif
 }

Henry Bent <hbent>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by hbent (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-30 bens Open/ClosedOpen Closed
    2020-07-22 bens Summaryolder compilers do not understand &quot;\e&quot; older compilers do not understand "\e"; use "\x1B" instead
    2020-07-22 bens StatusNone Fixed
        Assigned toNone bens
        SummaryUse \x1B instead of \e in nano.c older compilers do not understand "\e"
    2020-07-21 bens Severity3 - Normal 2 - Minor

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code