apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "César Leonardo Blum Silveira" <cesa...@gmail.com>
Subject Patch for passing NULL as value argument to apr_env_get
Date Fri, 25 Apr 2008 16:24:43 GMT

Some time ago I wrote a piece of code which only needed to check
whether and environment variable was defined. Since I did not care
about the value the variable contained, I was a little annoyed by the
fact that I had to declare a variable only to pass it as the value
argument to apr_env_get. So I decided to modify the source in order to
only set the value variable when it is passed, i.e. is not NULL.

I see this is somewhat contrary to what the guidelines say, "One
notable standard that has been adopted within APR functions (and is
partly due to APR's httpd lineage) is that the input values do not
need to be checked for correctness.". However, I still think my
modification might be useful to other people.

Attached is the patch file. This is the first patch I ever made for
APR, so I don't know if it is precisely correct. Please review the
filenames in it.


César L. B. Silveira

View raw message