/[path-sandbox]/trunk/src/sandbox_utils.c
Gentoo

Diff of /trunk/src/sandbox_utils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 262 Revision 263
168 168
169bool is_env_on (const char *env) 169bool is_env_on (const char *env)
170{ 170{
171 if ((NULL != env) && (NULL != getenv(env)) && 171 if ((NULL != env) && (NULL != getenv(env)) &&
172 ((0 == strncasecmp(getenv(env), "1", 1)) || 172 ((0 == strncasecmp(getenv(env), "1", 1)) ||
173 (0 == strncasecmp(getenv(env), "true", 4)) ||
173 (0 == strncasecmp(getenv(env), "yes", 3)))) 174 (0 == strncasecmp(getenv(env), "yes", 3))))
174 return true; 175 return true;
175 176
176 return false; 177 return false;
177} 178}
178 179
180bool is_env_off (const char *env)
181{
182 if ((NULL != env) && (NULL != getenv(env)) &&
183 ((0 == strncasecmp(getenv(env), "0", 1)) ||
184 (0 == strncasecmp(getenv(env), "false", 5)) ||
185 (0 == strncasecmp(getenv(env), "no", 2))))
186 return true;
187
188 return false;
189}
190
179char * gstrndup (const char *str, size_t size) 191char * gstrndup (const char *str, size_t size)
180{ 192{
181 char *new_str = NULL; 193 char *new_str = NULL;
182 size_t len; 194 size_t len;
183 195

Legend:
Removed from v.262  
changed lines
  Added in v.263

  ViewVC Help
Powered by ViewVC 1.1.20