[chocolate-doom] 48/79: Strip carriage returns from the end of lines when reading configuration files.

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:07:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.1.3
in repository chocolate-doom.

commit 2d20dee9798613951023bc570104a6f80f0ef628
Author: Simon Howard <fraggle at gmail.com>
Date:   Sun Jan 8 18:22:39 2006 +0000

    Strip carriage returns from the end of lines when reading configuration
    files.
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 276
---
 src/m_misc.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/m_misc.c b/src/m_misc.c
index 17e5c78..8fc0193 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: m_misc.c 274 2006-01-08 18:13:33Z fraggle $
+// $Id: m_misc.c 276 2006-01-08 18:22:39Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -23,6 +23,10 @@
 //
 //
 // $Log$
+// Revision 1.15  2006/01/08 18:22:39  fraggle
+// Strip carriage returns from the end of lines when reading configuration
+// files.
+//
 // Revision 1.14  2006/01/08 18:13:33  fraggle
 // show_endoom config file option to disable the endoom screen
 //
@@ -86,7 +90,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: m_misc.c 274 2006-01-08 18:13:33Z fraggle $";
+rcsid[] = "$Id: m_misc.c 276 2006-01-08 18:22:39Z fraggle $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -525,6 +529,14 @@ static void LoadDefaultCollection(default_collection_t *collection)
           
             continue;
         }
+
+        // Strip off trailing non-printable characters (\r characters
+        // from DOS text files)
+
+        while (strlen(strparm) > 0 && !isprint(strparm[strlen(strparm)-1]))
+        {
+            strparm[strlen(strparm)-1] = '\0';
+        }
         
         // Find the setting in the list
        

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list