From 3d9f40d22a372d8ce7b2d052dbb23c8a0c160f48 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Thu, 23 Mar 2023 10:20:50 +0300 Subject: [PATCH] Indent --- src/backend/distributed/utils/attribute.c | 58 ++++++++++++----------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/src/backend/distributed/utils/attribute.c b/src/backend/distributed/utils/attribute.c index f2d3fc6a2..b6c4e8426 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -611,42 +611,43 @@ MultiTenantMonitorshmemSize(void) static char * ExtractTopComment(const char *inputString) { - int commentCharsLength = 2; - int inputStringLen = strlen(inputString); - if (inputStringLen < commentCharsLength) - { - return NULL; - } + int commentCharsLength = 2; + int inputStringLen = strlen(inputString); + if (inputStringLen < commentCharsLength) + { + return NULL; + } - const char *commentStartChars = "/*"; - const char *commentEndChars = "*/"; + const char *commentStartChars = "/*"; + const char *commentEndChars = "*/"; - /* If query doesn't start with a comment, return NULL */ - if (strstr(inputString, commentStartChars) != inputString) - { - return NULL; - } + /* If query doesn't start with a comment, return NULL */ + if (strstr(inputString, commentStartChars) != inputString) + { + return NULL; + } - StringInfo commentData = makeStringInfo(); + StringInfo commentData = makeStringInfo(); - /* Skip the comment start characters */ - const char *commentStart = inputString + commentCharsLength; + /* Skip the comment start characters */ + const char *commentStart = inputString + commentCharsLength; - /* Find the first comment end character */ - const char *commentEnd = strstr(commentStart, commentEndChars); - if (commentEnd == NULL) - { - return NULL; - } + /* Find the first comment end character */ + const char *commentEnd = strstr(commentStart, commentEndChars); + if (commentEnd == NULL) + { + return NULL; + } - /* Append the comment to the StringInfo buffer */ - int commentLength = commentEnd - commentStart; - appendStringInfo(commentData, "%.*s", commentLength, commentStart); + /* Append the comment to the StringInfo buffer */ + int commentLength = commentEnd - commentStart; + appendStringInfo(commentData, "%.*s", commentLength, commentStart); - /* Return the extracted comment */ - return commentData->data; + /* Return the extracted comment */ + return commentData->data; } + /* EscapeCommentChars adds a backslash before each occurrence of '*' or '/' in the input string */ static char * EscapeCommentChars(const char *str) @@ -663,11 +664,12 @@ EscapeCommentChars(const char *str) } appendStringInfoChar(escapedString, str[originalStringIndex]); - } + } return escapedString->data; } + /* UnescapeCommentChars removes the backslash that precedes '*' or '/' in the input string. */ static char * UnescapeCommentChars(const char *str)