Hello!
On Tue, Jan 12, 2021 at 12:40:06AM +0000, Chris Newton wrote:
> I just came across a problem with an innocuous looking line of code in a
> new module I have been working on:
>
> if (tmp_str.len == 0)
>
> ngx_str_set(&tmp_str, "/");
>
>
> The modification of tmp_str.data to '/' was always being made, but the
> length wasn't if the test failed. This turns out to be caused by the style
> used in the definition of the ngx_str_set macro.
I always wonder why people intentionally ignore nginx style and
then complain something doesn't work for them. Following nginx
style and always using curly brackets is how it is expected to
work.
--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel