patchThe GNU Bourne-Again SHell - Patches: patch #10070, toggle invert flag when reading `!'

 
 

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

patch #10070: toggle invert flag when reading `!'

Submitted by:  Vincent Menegaux <vimene>
Submitted on:  Sat 22 May 2021 06:45:21 PM UTC  
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Open

Mon 24 May 2021 03:56:03 PM UTC, comment #1: 

Interestingly, ksh93 produces the same result as bash. I agree that it's more intuitive to toggle it.

Chet Ramey <chet>
Project Administrator
Sat 22 May 2021 06:45:21 PM UTC, original submission:  

Previously, these commands:

  [[ ! 1 -eq 1 ]]; echo $?
  [[ ! ! 1 -eq 1 ]]; echo $?

would both result in `1', since parsing `!' set CMD_INVERT_RETURN
instead of toggling it.

After this change,

  [[ ! 1 -eq 1 ]]; echo $?

result in `1', and

  [[ ! ! 1 -eq 1 ]]; echo $?

result in `0', which is the expected behavior.

Vincent Menegaux <vimene>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by vimene (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-24 chet StatusNone => Done
    2021-05-22 vimene Attached File- => Added 0001-toggle-invert-flag-when-reading.patch, #51462

    Back to the top


    Powered by Savane 3.6