]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Let args_init_from_gcc_atfile split on carriage return as well
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 8 Aug 2012 16:56:56 +0000 (18:56 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 8 Aug 2012 16:56:56 +0000 (18:56 +0200)
args.c
test/test_args.c

diff --git a/args.c b/args.c
index cff4873ff22d4cf02f7332a932f1a3384b4c36dc..67c61160c411576f46c704e2eddb55fc2e689776 100644 (file)
--- a/args.c
+++ b/args.c
@@ -97,6 +97,7 @@ args_init_from_gcc_atfile(const char *filename)
                        }
 
                case '\n':
+               case '\r':
                case '\t':
                case ' ':
                        if (quoting) {
index 5c1b19d54ac912f964588f26999fa0e010ae42de..27c6fb9d06d2370f8849e8bb95895fb6f7adca03 100644 (file)
@@ -63,7 +63,9 @@ TEST(args_init_from_string)
 TEST(args_init_from_gcc_atfile)
 {
        struct args *args;
-       const char *argtext = "first sec\\\tond\tthi\\\\rd\nfourth  \tfif\\ th \"si'x\\\" th\" 'seve\nth'\\";
+       const char *argtext =
+               "first\rsec\\\tond\tthi\\\\rd\nfourth  \tfif\\ th \"si'x\\\" th\""
+               " 'seve\nth'\\";
 
        create_file("gcc_atfile", argtext);