From ae655c8020dbf3a720b975be2b4b2fad44da5a65 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 18 Oct 2015 00:24:53 +0000 Subject: [PATCH] Fix whitespace --- catdoc.d | 54 ++++++++++++++++++++++++------------------------ get_dlibcurl32.d | 32 ++++++++++++++-------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/catdoc.d b/catdoc.d index 3ddf3438e3..690101d93b 100755 --- a/catdoc.d +++ b/catdoc.d @@ -16,51 +16,51 @@ int main(string[] args) { if (args.length < 2) { - writeln("catdoc: Concatenate Ddoc files + writeln("catdoc: Concatenate Ddoc files Usage: catdoc -o=outputfile sourcefiles... "); - return 1; + return 1; } string ofile; getopt(args, "o", &ofile); if (!ofile.ptr) { - writeln("catdoc: set output file with -o=filename"); - return 1; + writeln("catdoc: set output file with -o=filename"); + return 1; } if (args.length < 2) { - writeln("catdoc: no input files"); - return 1; + writeln("catdoc: no input files"); + return 1; } string comment = "Ddoc\n"; string macros; foreach (arg; args[1..$]) { - //writeln(arg); - string input = cast(string)std.file.read(arg); - if (input.length < 4 || input[0..4] != "Ddoc") - { writefln("catdoc: %s is not a Ddoc file", arg); - return 1; - } - foreach (i, c; input) - { - if (c == '\n') - { - if (i + 8 < input.length && std.string.icmp(input[i + 1 .. i + 8], "Macros:") == 0) - { - comment ~= input[4 .. i + 1]; - if (!macros.ptr) - macros = "Macros:\n"; - macros ~= input[i + 8 .. $]; - goto L1; - } - } - } - comment ~= input[4 .. $]; + //writeln(arg); + string input = cast(string)std.file.read(arg); + if (input.length < 4 || input[0..4] != "Ddoc") + { writefln("catdoc: %s is not a Ddoc file", arg); + return 1; + } + foreach (i, c; input) + { + if (c == '\n') + { + if (i + 8 < input.length && std.string.icmp(input[i + 1 .. i + 8], "Macros:") == 0) + { + comment ~= input[4 .. i + 1]; + if (!macros.ptr) + macros = "Macros:\n"; + macros ~= input[i + 8 .. $]; + goto L1; + } + } + } + comment ~= input[4 .. $]; L1: ; } diff --git a/get_dlibcurl32.d b/get_dlibcurl32.d index 90f0d8c845..880b2f1210 100644 --- a/get_dlibcurl32.d +++ b/get_dlibcurl32.d @@ -88,27 +88,27 @@ int main(string[] args) showHelp(); return 1; } - + if(args[1] == "--help") { showHelp(); return 0; } - + // Setup paths auto curlVersion = args[1]; curlUrl = curlUrl .replace("$(CURL_VERSION)", curlVersion); curlZipBase = curlZipBase.replace("$(CURL_VERSION)", curlVersion); outputDir ~= "-" ~ curlVersion; workDir = buildPath(tempDir(), workDirName); - + checkImplib(); - + // Clear temporary work dir writeln("Clearing temporary work dir: ", workDir); removeDir(workDir); makeDir(workDir); - + // Archive paths auto unzipArchivePath = buildPath(workDir, "unzip", unzipArchiveName); auto basicUtilsArchivePath = buildPath(workDir, "bup", basicUtilsArchiveName); @@ -122,7 +122,7 @@ int main(string[] args) if(!hasImplib) download(basicUtilsUrl, basicUtilsArchivePath); download(curlUrl, curlArchivePath); - + // Extract { auto saveDir = getcwd(); @@ -140,20 +140,20 @@ int main(string[] args) chdir(workDir); unzip(curlArchivePath); } - + // Generate import lib auto curlDir = buildPath(workDir, curlZipBase); implib(buildPath(curlDir, "libcurl")); - + // Copy results out of temp dir writeln("Copying results to '", outputDir, "'"); removeDir(outputDir); copyDir(curlDir, outputDir); - - writeln("Done."); - writeln("Your OPTLINK-compatable libcurl.lib, along with the rest of libcurl,"); - writeln("is in the directory: ", outputDir); - + + writeln("Done."); + writeln("Your OPTLINK-compatable libcurl.lib, along with the rest of libcurl,"); + writeln("is in the directory: ", outputDir); + return 0; } @@ -169,7 +169,7 @@ void copyDir(string src, string dest) // Needed to generate 'relativePath' correctly. if(!src.endsWith(dirSeparator)) src ~= dirSeparator; - + makeDir(dest); foreach(DirEntry entry; dirEntries(src, SpanMode.breadth)) { @@ -191,11 +191,11 @@ void removeDir(string path) { if(exists(path)) { - auto failMsg = + auto failMsg = "Failed to remove directory: "~path~"\n"~ " A process may still holding an open handle within the directory.\n"~ " Either delete the directory manually or try again later."; - + try system("rmdir /S /Q "~quote(path)); catch(Exception e)