Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 171373 Details for
Bug 212689
sci-chemistry/ghemical-2.10: import scrambles molecule structure
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
a patch for import/export errors due to non-"C" system locale
ghemical-2.95-import_export.patch (text/plain), 1.26 KB, created by
Reinis Danne
on 2008-11-10 21:54:19 UTC
(
hide
)
Description:
a patch for import/export errors due to non-"C" system locale
Filename:
MIME Type:
Creator:
Reinis Danne
Created:
2008-11-10 21:54:19 UTC
Size:
1.26 KB
patch
obsolete
>--- src/project.cpp 2007-08-16 11:20:00.000000000 +0200 >+++ src/project.cpp 2008-11-10 21:39:15.000000000 +0200 >@@ -307,6 +307,12 @@ > ifstream ifile; > ostringstream intermed; > file_trans translator; >+ >+ // Store the current locale and switch to "C" >+ >+ static char my_num_locale[32] = "C"; >+ strcpy(my_num_locale, setlocale(LC_NUMERIC, NULL)); >+ setlocale(LC_NUMERIC, "C"); > > if (index == 0) // Automatic detection > { >@@ -328,7 +334,13 @@ > } > > istringstream interInput(intermed.str()); >- return ReadGPR((* this), interInput, false); >+ bool retval = ReadGPR((* this), interInput, false); >+ >+ // Change back to the original locale >+ >+ setlocale(LC_NUMERIC, my_num_locale); >+ >+ return retval; > } > > bool project::ExportFile(const char * filename, int index) >@@ -337,6 +349,12 @@ > stringstream intermed; > file_trans translator; > >+ // Store the current locale and switch to "C" >+ >+ static char my_num_locale[32] = "C"; >+ strcpy(my_num_locale, setlocale(LC_NUMERIC, NULL)); >+ setlocale(LC_NUMERIC, "C"); >+ > WriteGPR_v100((* this), intermed); // this is for openbabel-1.100.2 > istringstream interInput(intermed.str()); > >@@ -359,6 +377,10 @@ > ofile.close(); > } > >+ // Change back to the original locale >+ >+ setlocale(LC_NUMERIC, my_num_locale); >+ > return true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212689
:
163479
|
163481
|
163482
|
163487
|
163488
|
163490
|
163492
| 171373 |
171375
|
171376