From e8f533b27b73b597f43fd24b255d033945a01ee1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 21 Jun 2010 10:10:36 +0000 Subject: [PATCH] Fix a bug in native version of collectcatkeys (not the one used in buildtools) that prevented it from working at all. This fixes #4840 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37185 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/locale/collectcatkeys.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/locale/collectcatkeys.cpp b/src/bin/locale/collectcatkeys.cpp index d41462e4c9..4e780390f7 100644 --- a/src/bin/locale/collectcatkeys.cpp +++ b/src/bin/locale/collectcatkeys.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009, Haiku. + * Copyright 2003-2010, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -64,11 +64,13 @@ bool fetchStr(const char *&in, BString &str, bool lookForID) { int parLevel = 0; + while (isspace(*in) || *in == '(') { if (*in == '(') parLevel++; in++; } + if (*in == '"') { bool inString = true; bool quoted = false; @@ -77,7 +79,7 @@ fetchStr(const char *&in, BString &str, bool lookForID) { // Collect string content until we find a quote marking end of // string (skip escaped quotes) - while (*in != '"' || !quoted) + while (*in != '"' || quoted) { str.Append(in,1); if (*in == '\\' && !quoted) @@ -251,6 +253,7 @@ main(int argc, char **argv) usage(); } } + if (!outputFile.Length() && inputFile) { // generate default output-file from input-file by replacing // the extension with '.catkeys': @@ -270,6 +273,7 @@ main(int argc, char **argv) strerror(res)); exit(-1); } + off_t sz; inFile.GetSize(&sz); if (sz > 0) {