Tíquete #36880

Variables assigned on function call should be local

: 2016-12-16 23:11 Última Atualização: 2016-12-19 23:19

Relator:
Dono:
Estado:
Fechado
Componente:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
Nenhum
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

The effect of assignments in a simple command was clarified in POSIX.1-2016. The behavior of yash 2.43 meets the new requirements, but they allow different behaviors.

In yash 2.43, variables assigned in a simple command that calls a function remain after the function returns. This behavior is inconsistent with variables assigned in a simple command that executes an external command, which are only effective during the command. To make functions behave more like external commands, variables should not remain after functions return.

Comparison of shell behaviors:

ShellDuring functionAfter function
yash 2.43ExportedExported
bash 4.3.43 as shExportedExported
bash 4.3.43 as bashExportedUnset
dash 0.5.9Not exportedNot exported
ksh 93u+ 2012-08-01Not exportedNot exported
mksh 54ExportedExported
zsh 5.2 as shExportedExported
zsh 5.2 as zshExportedUnset

Ticket History (3/3 Histories)

2016-12-16 23:11 Updated by: magicant
  • New Ticket "Variables assigned on function call should be local" created
2016-12-17 00:21 Updated by: magicant
  • Details Updated
2016-12-19 23:19 Updated by: magicant
  • Resolução Update from Nenhum to Fixed
  • Estado Update from Aberto to Fechado
  • Ticket Close date is changed to 2016-12-19 23:19
Comentário

Implemented in r3752

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login