Questions tagged [line-endings]

Line-ending signifies end of line. Depending on operating system line-endings are different.

465 questions
0
votes
1 answer

fprintf ignore ^M carriage returns

I have my fopen set up like this. I have tried my fopen with both "t" and without "t". For some reason my fprintf is printing out ^M which are carriage returns. How do I stop frpintf from doing this? I want to just use the normal new line…
cokedude
  • 359
  • 8
  • 20
0
votes
3 answers

Add Carriage-Return utility in C printing garbage?

I have the following program in C, which is intended to convert UNIX text files to Windows format (LF->CR LF). Basically the intended usage is addcr infile > outfile in the command line: #include #include #include…
Govind Parmar
  • 18,500
  • 6
  • 49
  • 78
0
votes
1 answer

git line ends redux - Mac OS git with contributions for Windows user

I do development on Mac OS X. I have a user who is contributing code with CRLF line endings. He currently does not use git. I create a branch, then switch my working tree to it. I copy his file into the working tree. When I try to stage the file, I…
0
votes
0 answers

PHP SoapClient error with line endings

I have a SoapServer running on a windows machine. When I try to instantiate a SoapClient object from a linux machine, it fails with a nice PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from…
Gnujeremie
  • 501
  • 3
  • 14
0
votes
1 answer

Same behavior of read line with java randomAccessFile on x32 or x64?

I use java 6 method readByte() from class randomAccessFile to read text files on linux x64. I'm looking the end of text line by finding "0xD" or "0xA" at the end. My question is : in case operating system will switch to x32 , will the find…
Toren
  • 5,630
  • 11
  • 37
  • 52
0
votes
1 answer

git: how to tell if a file accidentally was committed with CRLF

In my specific case, I am using git-p4 and I want to know if git-p4 committed the files with CRLF in the actual committed objects themselves. In general, though, I wan to know how to directly find out. In other words, when I checkout normally,…
Alexander Bird
  • 33,259
  • 40
  • 118
  • 154
0
votes
2 answers

How to remove extra empty lines from file with mac line endings in VS 2008?

So that's the question...perhaps there's a regular expression for this? Just to be clear, I don't want to remove ALL newlines and bunch all of the code together, only the extras. I'm not familiar with how to construct regexes, so any help is greatly…
0
votes
1 answer

Writing/reading a file in binary mode in Clisp

I'm writing this program that's supposed to read from a file, do some stuff with the content and write to an output file preserving the original line endings. If the file has CRLF endings, the output file should also have that. My problem is in…
Plakhoy
  • 1,736
  • 1
  • 17
  • 29
0
votes
1 answer

.gitattributes and normalizing line-endings: changed files still there

I am confused with .gitattributes behavior. Following the article about normalizing line-endings, I have done following steps: created .gitattiributes with * text=auto on my dev Windows machine I have core.autocrlf = true on my build Linux machine…
glaz666
  • 8,415
  • 17
  • 53
  • 73
0
votes
2 answers

How to recover a git repository that has been corrupted by having line endings changes from CRLF to LF?

I changed all of the line endings in my project from dos mode to unix mode by removing all of the carriage returns from any file that had them: grep -lIUr '^M' . | xargs sed -i 's/^M//' I thought that it would ignore hidden dotfiles like .git/, but…
Dan Ross
  • 3,396
  • 2
  • 28
  • 53
0
votes
1 answer

How to end a statement in Ruby

I have code like word.include?("test") ? @test = word : #do nothing My issue is that rails expects something after the colon and treats the next line of code as if it's part of the conditional statement above. I know I can use a regular if end…
Steve
  • 4,195
  • 6
  • 31
  • 48
0
votes
1 answer

Specify line.separator as a compiler setting?

As suggested by this answer: You can call System.setProperty("line.separator", "\r\n"); in order to set the system property inside your code. it is quite easy to make a Java program output the desired line endings. However, I see no reason why…
Christian Neverdal
  • 4,815
  • 5
  • 32
  • 87
0
votes
1 answer

Using Windows line endings in Perl6::Form

I'm using Perl6::Form to generate a table and output it to a text file. No matter what I do, it seems, I can't output Windows line endings. I've tried local $OUTPUT_RECORD_SEPARATOR = "\r\n"; I've tried appending \r\n to my format strings. No…
Kit Peters
  • 1,772
  • 1
  • 13
  • 25
0
votes
2 answers

Visual Basic- "IF" doesn't end

If My.Computer.FileSystem.FileExists("pack/locale_ro.epk") Then My.Computer.FileSystem.DeleteFile("pack/locale_ro.epk") PB_GSM.Value = 10 If My.Computer.FileSystem.FileExists("pack/locale_ro.eix") Then…
0
votes
1 answer

Create convert_line_endings function

I have a configuration file that is supposed to have \r\n line ending style, and I want to include the code in my program to check and correct the format. Existing code: int convert_line_endings(FILE *fp) { char c = 0, lastc = 0, cnt = 0; …
BenjiWiebe
  • 1,885
  • 3
  • 20
  • 39
1 2 3
30
31