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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user