Bug in dash: Incorrect behaviour of $LINENO in function

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

 



Dear sir or madam,

For the following script,
foo(){ echo $LINENO; }
foo
foo(){
  echo $LINENO
}
foo
dash incorrectly prints 2 for the foo on the last line. It seems dash stores the line number of the parameter substitution and the line number of the function definition, and add them to get the result. But the latter is not updated with the function get redefined.

Thanks.





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux