From 8c452651b80b8eb16892208982f7269af2db162a Mon Sep 17 00:00:00 2001 From: John Sebastian Peterson Date: Wed, 19 Jul 2023 22:07:23 +0000 Subject: [PATCH] Allow zero indentation Its a no brainer and the quickest way to get rid of whitespace since this tool is indispensable anyway I was wrestling all day with bindiff files with unreadable trailing space. I just need things like this to work --- AStyle/src/astyle_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AStyle/src/astyle_main.cpp b/AStyle/src/astyle_main.cpp index 276e518..fba9baa 100644 --- a/AStyle/src/astyle_main.cpp +++ b/AStyle/src/astyle_main.cpp @@ -3273,7 +3273,7 @@ void ASOptions::parseOption(const std::string& arg, const std::string& errorInfo std::string spaceNumParam = getParam(arg, "t", "indent=tab="); if (spaceNumParam.length() > 0) spaceNum = atoi(spaceNumParam.c_str()); - if (spaceNum < 2 || spaceNum > 20) + if (spaceNum > 20) isOptionError(arg, errorInfo); else { @@ -3324,7 +3324,7 @@ void ASOptions::parseOption(const std::string& arg, const std::string& errorInfo std::string spaceNumParam = getParam(arg, "s", "indent=spaces="); if (spaceNumParam.length() > 0) spaceNum = atoi(spaceNumParam.c_str()); - if (spaceNum < 2 || spaceNum > 20) + if (spaceNum > 20) isOptionError(arg, errorInfo); else {