?
Solved

sourceforge code carriage returns

Posted on 2010-01-04
8
Medium Priority
?
320 Views
Last Modified: 2012-05-08

hello, I downloaded some source code from sourceforge.  It's one of those deals where it is an open source project for both linux and windows, and there are separate build instructions for the two platforms.  what I downloaded was the source code in a .tar.gz format.

However after I unpack the .tar.gz (had to install winace to do it on windows), it appears that all the source code files are screwed up with respect to carriage returns.  Looks like valid C code, but all on one line.

Is it following a linux or apple format rather than windows?  Is there some sort of converter, or is it more likely that I downloaded the wrong version?  (there only appeared to be one source download at http://open-ms.sourceforge.net/download.php )

Anyway, any advice?  Thanks very much in advance.
0
Comment
Question by:riceman0
  • 4
  • 2
  • 2
8 Comments
 
LVL 6

Accepted Solution

by:
ollfried earned 1000 total points
ID: 26174140
What do you want to do, look at the code? Then just open it with wordpad. In Linux you can simply recode the newlines to cr+nl, but I don't know how to do this in windows.
0
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 1000 total points
ID: 26174167
It probably uses a single \n (newline) character at the end of each line, while Windows expects two characters : \r (carriage return) and \n.

Usually however, Windows text editors correctly read them (and convert them) either way, so I'm surprised that didn't happen for you. Try opening it in a different text editor, and see if that works better.
0
 

Author Comment

by:riceman0
ID: 26174182
oh... now that you mention it both wordpad and visual studio can deal with it and it looks correct.  But notepad does not.

What's going on, is it CR instead of CRLF?

0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:riceman0
ID: 26174188
Got it, thanks guys.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 26174190
>> What's going on, is it CR instead of CRLF?

Depending on the editor used to write the code, it might be. You could always check that with a hex editor.
0
 
LVL 6

Expert Comment

by:ollfried
ID: 26174192
Yes, that's it. Unixes use only newline windows needs an additional carriage-return. Notepad cannot deal with that.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 26174239
I seem to recall that notepad shows a block instead of the newline character, so even if the newlines aren't interpreted correctly, at least you get a visual clue that something went wrong.
Maybe they changed that in the most recent versions of Windows ?
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 26174339
>> You could always check that with a hex editor.

Just checked on a random source file from the archive you linked to, and it was using newlines as line delimiters (standard UNIX).
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is about my experience upgrading my consulting machine to Windows 10 Version 1709 (The Fall 2017 Creator Update)
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question