From: Alan T. DeKok Date: Wed, 7 Dec 2016 00:22:12 +0000 (-0500) Subject: indentation helps X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0449ec6cd17d19d1a68acfee5040ab315bb602c;p=thirdparty%2Ffreeradius-server.git indentation helps --- diff --git a/src/main/xlat.c b/src/main/xlat.c index 4b0c97dd156..fd2cc52c318 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -1614,12 +1614,12 @@ static void xlat_tokenize_debug(REQUEST *request, xlat_exp_t const *node) #endif case XLAT_ALTERNATE: - RDEBUG3("if {"); - xlat_tokenize_debug(request, node->child); - RDEBUG3("}"); - RDEBUG3("else {"); - xlat_tokenize_debug(request, node->alternate); - RDEBUG3("}"); + DEBUG("%.*sXLAT-IF {", lvl, xlat_tabs); + xlat_tokenize_debug(request, lvl + 1); + DEBUG("%.*s}", lvl, xlat_tabs); + DEBUG("%.*sXLAT-ELSE {", lvl, xlat_tabs); + xlat_tokenize_debug(request, lvl + 1); + DEBUG("%.*s}", lvl, xlat_tabs); break; } node = node->next; @@ -2123,7 +2123,7 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c * Don't escape this. */ case XLAT_LITERAL: - XLAT_DEBUG("xlat_aprint LITERAL"); + XLAT_DEBUG("%.*sxlat_aprint LITERAL", lvl, xlat_spaces); return talloc_typed_strdup(ctx, node->fmt); /* @@ -2137,7 +2137,7 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c time_t when; long int microseconds; - XLAT_DEBUG("xlat_aprint PERCENT"); + XLAT_DEBUG("%.*sxlat_aprint PERCENT", lvl, xlat_spaces); str = talloc_array(ctx, char, freespace); /* @todo do better allocation */ p = node->fmt; @@ -2243,15 +2243,15 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c break; case XLAT_ATTRIBUTE: - XLAT_DEBUG("xlat_aprint ATTRIBUTE"); + XLAT_DEBUG("%.*sxlat_aprint ATTRIBUTE", lvl, xlat_spaces); /* * Some attributes are virtual */ str = xlat_getvp(ctx, request, &node->attr, escape ? false : true, true); if (str) { - XLAT_DEBUG("EXPAND attr %s", node->attr.tmpl_da->name); - XLAT_DEBUG(" ---> %s", str); + XLAT_DEBUG("%.*sEXPAND attr %s", lvl, xlat_spaces, node->attr.tmpl_da->name); + XLAT_DEBUG("%.*s ---> %s", lvl ,xlat_spaces, str); } break; @@ -2350,25 +2350,25 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c #ifdef HAVE_REGEX case XLAT_REGEX: - XLAT_DEBUG("xlat_aprint REGEX"); + XLAT_DEBUG("%.*sxlat_aprint REGEX", lvl, xlat_spaces); if (regex_request_to_sub(ctx, &str, request, node->attr.tmpl_num) < 0) return NULL; break; #endif case XLAT_ALTERNATE: - XLAT_DEBUG("xlat_aprint ALTERNATE"); + XLAT_DEBUG("%.*sxlat_aprint ALTERNATE", lvl, xlat_spaces); rad_assert(node->child != NULL); rad_assert(node->alternate != NULL); - str = xlat_aprint(ctx, request, node->child, escape, escape_ctx, lvl); + str = xlat_aprint(ctx, request, node->child, escape, escape_ctx, lvl + 1); if (str) { - XLAT_DEBUG("ALTERNATE got string: %s", str); + XLAT_DEBUG("%.*sALTERNATE got string: %s", lvl, xlat_spaces, str); break; } - XLAT_DEBUG("ALTERNATE going to alternate"); - str = xlat_aprint(ctx, request, node->alternate, escape, escape_ctx, lvl); + XLAT_DEBUG("%.*sALTERNATE going to alternate", lvl, xlat_spaces); + str = xlat_aprint(ctx, request, node->alternate, escape, escape_ctx, lvl + 1); break; }