dect
/
asterisk
Archived
13
0
Fork 0

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
This commit is contained in:
rizzo 2007-12-08 17:58:08 +00:00
parent 385fb74486
commit b4a97437e3
1 changed files with 5 additions and 0 deletions

View File

@ -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;