diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-08 17:58:08 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-08 17:58:08 +0000 |
commit | b4a97437e3500dc240da9081315b63e44996fea5 (patch) | |
tree | b29f121606354a07d15cfcd368e2eb4fe9cf33fb /main/config.c | |
parent | 385fb74486ed90dcbfef83546bf7040694d3487e (diff) |
document a nice technique to exit from a block in case of errors.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91951 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/config.c')
-rw-r--r-- | main/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c index ef65c8e62..1f29ee120 100644 --- a/main/config.c +++ b/main/config.c @@ -1153,6 +1153,11 @@ static struct ast_config *config_text_file_load(const char *database, const char for (i=0; i<globbuf.gl_pathc; i++) { ast_copy_string(fn, globbuf.gl_pathv[i], sizeof(fn)); #endif + /* + * The following is not a loop, but just a convenient way to define a block + * (using do { } while(0) ), and be able to exit from it with 'continue' + * or 'break' in case of errors. Nice trick. + */ do { if (stat(fn, &statbuf)) continue; |