From 810ffa09c75950ee1c30894ce4afc066f85e5aeb Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 22 May 2010 01:22:53 +0000 Subject: [PATCH] Convert the identifier to an std::string from wxString. For whatever reason wxString is producing addresses rather than strings when automatically converting. I've seen this behaviour before and it seems quite random. This will solve that problem. Originally committed to SVN as r4342. --- aegisub/tools/common-respack.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/aegisub/tools/common-respack.cpp b/aegisub/tools/common-respack.cpp index 86943ffff..91745a888 100644 --- a/aegisub/tools/common-respack.cpp +++ b/aegisub/tools/common-respack.cpp @@ -40,7 +40,6 @@ #include #include #include - using namespace std; class FileIterator { @@ -56,7 +55,7 @@ public: FileIterator::FileIterator(int argc, const char **argv) : currentItem(2), inDir(false), currentDir(), items(argc, argv) { - if (argc == 2) { + if (argc == 2) { // No names passed on the command line, so read them from stdin char buffer[1024]; while (cin.getline(buffer, 1024), cin.good()) { @@ -81,7 +80,6 @@ bool FileIterator::Next(wxString *filename) { wxFileName next; wxString current = items[currentItem]; - currentItem++; // Test if it's a directory @@ -135,8 +133,9 @@ int main(int argc, const char *argv[]) { nameCleaner.ReplaceAll(&identifier, "_"); + std::string tmp(identifier.mb_str()); outC << "#include \"libresrc.h\"" << endl; - outC << "const unsigned char " << identifier << "[] = {"; + outC << "const unsigned char " << tmp << "[] = {"; bool first = true; char c[1]; while (infile.read(c, 1).gcount() > 0) { @@ -145,7 +144,7 @@ int main(int argc, const char *argv[]) { first = false; } outC << "};" << endl; - outH << "extern const unsigned char " << identifier << "[" << infile_end << "];" << endl; + outH << "extern const unsigned char " << tmp << "[" << infile_end << "];" << endl; } return 0;