[grisbi-bugs] [Grisbi-0.6.0 0000657]: Impossible to add/merge categories into new accounts file

bugtracker at grisbi.org bugtracker at grisbi.org
Wed Oct 7 21:32:01 CEST 2009


The following issue has been RESOLVED. 
====================================================================== 
http://grisbi.tuxfamily.org/mantis/view.php?id=657 
====================================================================== 
Reported By:                guneeyoufix
Assigned To:                guneeyoufix
====================================================================== 
Project:                    Grisbi-0.6.0
Issue ID:                   657
Category:                   Main
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Plateforme:                 Windows 
OS:                         Windows 
Version OS:                 Vista Familiale Premium 
Unstable Impact:            Yes 
Version GTK:                 
Resolution:                 fixed
Fixed in Version:           CVS (développement)
====================================================================== 
Date Submitted:             09-30-2009 21:52 UTC
Last Modified:              10-07-2009 19:32 UTC
====================================================================== 
Summary:                    Impossible to add/merge categories into new accounts
file
Description: 
After creating and opening a brand new accounts file with no categories
because of bug 656 (http://grisbi.tuxfamily.org/mantis/view.php?id=656 ), I
tried to add categories using the menus.

In the file explorer that popped up, I selected a .cgsb file located in
share/categories/fr (grabbed from CVS) and clicked ok. That resulted in a
pop up window telling me that the file was not a proper Grisbi category
file.
====================================================================== 

---------------------------------------------------------------------- 
 guneeyoufix - 10-07-09 15:45  
---------------------------------------------------------------------- 
The category catalogs are indeed not identified as such by the windows
version of grisbi.

This comes from the direct comparison of files in src/gsb_file_others.c,
line 585 and following :

	    if ( !strncmp ( file_content,
			    "<?xml version=\"1.0\"?>\n<Grisbi_categ>",
			    36 ))

This works fine on Linux, but fails on Windows because of the end of line
characters (\n on Linux, \r\n on Windows).

--> One possible solution is to compare the file contents twice; once to
the string with UNIX line endings, and once to string with the DOS line
endings
Example:
	    if ( !strncmp ( file_content,
                            "<?xml version=\"1.0\"?>\n<Grisbi_categ>",
~                           36 ) ||
+                !strncmp ( file_content,
+                           "<?xml version=\"1.0\"?>\r\n<Grisbi_categ>",
+                           37 ))

I tried it with the categories, and it works. Therefore, no need to care
about the line endings.

 

---------------------------------------------------------------------- 
 guneeyoufix - 10-07-09 19:32  
---------------------------------------------------------------------- 
Fixed in gsb_file_others.c , revision 1.28

http://grisbi.cvs.sourceforge.net/viewvc/grisbi/grisbi/src/gsb_file_others.c?r1=1.27&r2=1.28


Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-30-09 21:52  guneeyoufix    New Issue                                    
09-30-09 21:52  guneeyoufix    Plateforme                => Windows         
09-30-09 21:52  guneeyoufix    OS                        => Windows         
09-30-09 21:52  guneeyoufix    Version OS                => Vista Familiale
Premium
09-30-09 21:52  guneeyoufix    Unstable Impact           => Yes             
10-05-09 16:23  guneeyoufix    Note Added: 0001175                          
10-05-09 16:23  guneeyoufix    Status                   new => confirmed    
10-05-09 16:24  guneeyoufix    Note Edited: 0001175                         
10-05-09 21:17  guneeyoufix    Description Updated                          
10-06-09 04:21  pbiava         Status                   confirmed => assigned
10-06-09 04:21  pbiava         Assigned To               => pbiava          
10-07-09 15:38  guneeyoufix    Assigned To              pbiava => guneeyoufix
10-07-09 15:39  guneeyoufix    Status                   assigned => confirmed
10-07-09 15:44  guneeyoufix    Note Edited: 0001175                         
10-07-09 15:45  guneeyoufix    Note Edited: 0001175                         
10-07-09 19:32  guneeyoufix    Status                   confirmed => resolved
10-07-09 19:32  guneeyoufix    Fixed in Version          => CVS (développement)
10-07-09 19:32  guneeyoufix    Resolution               open => fixed       
10-07-09 19:32  guneeyoufix    Note Added: 0001189                          
======================================================================



More information about the bugsreports mailing list