[cig-commits] [commit] master: Merge branch 'breaklines' of https://github.com/MFraters/aspect (a47d240)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon May 19 18:16:22 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/49421dcfc1bae9b9234e1f6a01b2da3198b8295c...a47d240e63234d5806d4fdb38f78b57c78948cf7

>---------------------------------------------------------------

commit a47d240e63234d5806d4fdb38f78b57c78948cf7
Merge: 49421dc aadd89b
Author: Timo Heister <timo.heister at gmail.com>
Date:   Mon May 19 21:16:00 2014 -0400

    Merge branch 'breaklines' of https://github.com/MFraters/aspect
    
    and fix some formatting



>---------------------------------------------------------------

a47d240e63234d5806d4fdb38f78b57c78948cf7
 source/main.cc | 45 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)

diff --cc source/main.cc
index 7aaad07,3e99e62..2cfbb55
--- a/source/main.cc
+++ b/source/main.cc
@@@ -156,6 -157,43 +156,45 @@@ void possibly_load_shared_libs (const s
  }
  
  
 -/** Look up break line sign (//) at the end of a line and merge this line with the next one  */
++/**
++ *  Look up break line sign (\\) at the end of a line and merge this line with the next one
++ */
+ std::string
+ expand_backslashes (const std::string &filename)
+ {
+   std::string result;
+ 
+   unsigned int need_empty_lines = 0;
+ 
+   std::ifstream input (filename.c_str());
+   while (input)
+     {
+       // get one line and strip spaces at the front and back
+       std::string line;
+       std::getline(input, line);
+       while ((line.size() > 0)
+              && (line[line.size() - 1] == ' ' || line[line.size() - 1] == '\t'))
+         line.erase(line.size() - 1, std::string::npos);
+ 
+       if ((line.size() > 0) && (line[line.size()-1] == '\\'))
+         {
 -          result += line.substr(0, line.size()-2);;
++          result += line.substr(0, line.size()-2);
+           ++need_empty_lines;
+         }
+       else
+         {
+           result += line;
+           result += '\n';
+ 
+           for (; need_empty_lines>0; --need_empty_lines)
+             result += '\n';
+         }
+     }
+ 
+   return result;
+ }
+ 
+ 
  int main (int argc, char *argv[])
  {
    using namespace dealii;



More information about the CIG-COMMITS mailing list