mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-22 14:56:13 +00:00
Changed: Discard \r and only use \n
This commit is contained in:
parent
8bb023850c
commit
95dd3ce9d0
2 changed files with 21 additions and 9 deletions
|
@ -502,17 +502,30 @@ void CI18N::skipWhiteSpace(ucstring::const_iterator &it, ucstring::const_iterato
|
|||
if (storeComments && *it == '/' && it+1 != last && *(it+1) == '/')
|
||||
{
|
||||
// found a one line C comment. Store it until end of line.
|
||||
while (it != last && *it != '\n')
|
||||
while (it != last && (*it != '\n' && *it != '\r'))
|
||||
storeComments->push_back(*it++);
|
||||
|
||||
// store the final '\n'
|
||||
if (it != last)
|
||||
storeComments->push_back(*it++);
|
||||
storeComments->push_back('\n');
|
||||
}
|
||||
else if (storeComments && *it == '/' && it+1 != last && *(it+1) == '*')
|
||||
{
|
||||
// found a multi line C++ comment. store until we found the closing '*/'
|
||||
while (it != last && !(*it == '*' && it+1 != last && *(it+1) == '/'))
|
||||
storeComments->push_back(*it++);
|
||||
while (it != last && !(*it == '*' && it + 1 != last && *(it + 1) == '/'))
|
||||
{
|
||||
// don't put \r
|
||||
if (*it == '\r')
|
||||
{
|
||||
// skip it
|
||||
++it;
|
||||
}
|
||||
else
|
||||
{
|
||||
storeComments->push_back(*it++);
|
||||
}
|
||||
}
|
||||
|
||||
// store the final '*'
|
||||
if (it != last)
|
||||
storeComments->push_back(*it++);
|
||||
|
@ -522,7 +535,6 @@ void CI18N::skipWhiteSpace(ucstring::const_iterator &it, ucstring::const_iterato
|
|||
storeComments->push_back(*it++);
|
||||
|
||||
// and a new line.
|
||||
storeComments->push_back('\r');
|
||||
storeComments->push_back('\n');
|
||||
}
|
||||
else
|
||||
|
|
|
@ -153,9 +153,9 @@ void showUsage(char *exeName)
|
|||
|
||||
void verifyVersion(ucstring& doc, int versionId)
|
||||
{
|
||||
ucstring version1("// DIFF_VERSION 1\r\n");
|
||||
ucstring version1("// DIFF_VERSION 1\n");
|
||||
ucstring::size_type version1Size = version1.size();
|
||||
ucstring version2("// DIFF_VERSION 2\r\n");
|
||||
ucstring version2("// DIFF_VERSION 2\n");
|
||||
ucstring::size_type version2Size = version2.size();
|
||||
|
||||
switch (versionId)
|
||||
|
@ -1071,7 +1071,7 @@ int makePhraseDiff(int argc, char *argv[])
|
|||
{
|
||||
LOG("Writing difference file for language %s\n", Languages[l].c_str());
|
||||
ucstring text;
|
||||
text += "// DIFF_VERSION 1\r\n";
|
||||
text += "// DIFF_VERSION 1\n";
|
||||
text += preparePhraseFile(diff, false);
|
||||
// add the tag for non translation
|
||||
text += nl + ucstring ("// REMOVE THE FOLOWING LINE WHEN TRANSLATION IS DONE") + nl + ucstring("// DIFF NOT TRANSLATED") + nl;
|
||||
|
@ -2805,7 +2805,7 @@ int makePhraseDiff2(int argc, char *argv[])
|
|||
{
|
||||
LOG("Writing difference file for language %s\n", Languages[l].c_str());
|
||||
ucstring text;
|
||||
text += "// DIFF_VERSION 2\r\n";
|
||||
text += "// DIFF_VERSION 2\n";
|
||||
text += preparePhraseFile(diff, false);
|
||||
// add the tag for non translation
|
||||
text += nl + ucstring ("// REMOVE THE FOLOWING LINE WHEN TRANSLATION IS DONE") + nl + ucstring("// DIFF NOT TRANSLATED") + nl;
|
||||
|
|
Loading…
Reference in a new issue