Mercurial > octave
diff src/ls-ascii-helper.cc @ 10315:57a59eae83cc
untabify src C++ source files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:41:46 -0500 |
parents | cd96d29c5efa |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/src/ls-ascii-helper.cc Thu Feb 11 12:23:32 2010 -0500 +++ b/src/ls-ascii-helper.cc Thu Feb 11 12:41:46 2010 -0500 @@ -49,34 +49,34 @@ char c = is.peek (); if (c == '\n' || c == '\r') - { - // Reached newline. - if (! keep_newline) - { - // Eat the CR or LF character. - char d; - is.get (d); - - // Make sure that for binary-mode opened ascii files - // containing CRLF line endings we skip the LF after CR. - if (c == '\r' && is.peek () == '\n') - { - // Yes, LF following CR, eat it. - is.get (d); - } - } - - // Newline was found, and read from stream if - // keep_newline == true, so exit loop. - break; - } + { + // Reached newline. + if (! keep_newline) + { + // Eat the CR or LF character. + char d; + is.get (d); + + // Make sure that for binary-mode opened ascii files + // containing CRLF line endings we skip the LF after CR. + if (c == '\r' && is.peek () == '\n') + { + // Yes, LF following CR, eat it. + is.get (d); + } + } + + // Newline was found, and read from stream if + // keep_newline == true, so exit loop. + break; + } else - { - // No newline charater peeked, so read it and proceed to next - // character. - char d; - is.get (d); - } + { + // No newline charater peeked, so read it and proceed to next + // character. + char d; + is.get (d); + } } } @@ -98,24 +98,24 @@ { // Yes, at newline. do - { - // Eat the CR or LF character. - char d; - is.get (d); - - // Make sure that for binary-mode opened ascii files - // containing CRLF line endings we skip the LF after CR. - if (c == '\r' && is.peek () == '\n') - { - // Yes, LF following CR, eat it. - is.get (d); - } - - // Peek into next character. - c = is.peek (); + { + // Eat the CR or LF character. + char d; + is.get (d); + + // Make sure that for binary-mode opened ascii files + // containing CRLF line endings we skip the LF after CR. + if (c == '\r' && is.peek () == '\n') + { + // Yes, LF following CR, eat it. + is.get (d); + } + + // Peek into next character. + c = is.peek (); - // Loop while still a newline ahead. - } + // Loop while still a newline ahead. + } while (c == '\n' || c == '\r'); } } @@ -138,37 +138,37 @@ char c = is.peek (); if (c == '\n' || c == '\r') - { - // Reached newline. - if (! keep_newline) - { - // Eat the CR or LF character. - char d; - is.get (d); - - // Make sure that for binary-mode opened ascii files - // containing CRLF line endings we skip the LF after - // CR. + { + // Reached newline. + if (! keep_newline) + { + // Eat the CR or LF character. + char d; + is.get (d); + + // Make sure that for binary-mode opened ascii files + // containing CRLF line endings we skip the LF after + // CR. - if (c == '\r' && is.peek () == '\n') - { - // Yes, LF following CR, eat it. - is.get (d); - } - } - - // Newline was found, and read from stream if - // keep_newline == true, so exit loop. - break; - } + if (c == '\r' && is.peek () == '\n') + { + // Yes, LF following CR, eat it. + is.get (d); + } + } + + // Newline was found, and read from stream if + // keep_newline == true, so exit loop. + break; + } else - { - // No newline charater peeked, so read it, store it, and - // proceed to next. - char d; - is.get (d); - buf << d; - } + { + // No newline charater peeked, so read it, store it, and + // proceed to next. + char d; + is.get (d); + buf << d; + } } return buf.str ();