bugPSPP - Bugs: bug #26542, pspp doesn't select the right...

 
 

bug #26542: pspp doesn't select the right folder to save its output on Windows

Submitted by:  Michel Boaventura <michelboaventura>
Submitted on:  Tue 12 May 2009 04:40:30 PM UTC  
 
Category: Compilation/PortabilitySeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 13 May 2009 10:57:47 PM UTC, comment #5:

It looks fine to me.

I pushed this patch and am closing this item. If it causes any further problems, then please re-open it.

John Darrington <jmd>
Project Administrator
Wed 13 May 2009 04:35:52 PM UTC, comment #4:

I made the attached patch, who only changes every 'OUTPUT_FILE_NAME' to 'output_file_name()' on 'src/ui/gui/psppire-output-window.c'.

It works, but I don't know if this is the best solution.

(file #18134)

Michel Boaventura <michelboaventura>
Project Member
Wed 13 May 2009 03:06:19 PM UTC, comment #3:

Your patch works nicely. But now we have another issue. Psppire saves its output on 'psppire.txt' in the users home folder, but doesn't shows it.

On src/ui/gui/psppire-output-window.c:348 there is:
ow->fp = fopen (OUTPUT_FILE_NAME, "r");

and on src/ui/gui/psppire-output-window.h:33 there is:
#define OUTPUT_FILE_NAME "psppire.txt"

I suppose that maybe it is trying to search for 'psppire.txt' on the current folder. Should it be changed so it uses the default_output_path() function to change this?

Michel Boaventura <michelboaventura>
Project Member
Wed 13 May 2009 12:56:30 AM UTC, comment #2:

I don't think it's a good idea to mutate the return value from getenv. Also, the comments didn't match the code in this function.

Can you try this patch instead.

(file #18131)

John Darrington <jmd>
Project Administrator
Tue 12 May 2009 05:00:32 PM UTC, comment #1:

To make it work I have to change WINDOWS32 to WIN32.
My last patch is wrong. Please remove it. The new one works.

(file #18130)

Michel Boaventura <michelboaventura>
Project Member
Tue 12 May 2009 04:40:30 PM UTC, original submission:

The last master branch doesn't change the right folder to sabe its output files on Windows. Looking at the source of 'src/data/file-name.c' seems like it is making a mistake.

Both HOMEPATH and HOMEDRIVE environment on windows use backslash as a folder separator, but pspp expects a slash.

I make the patch above, and it seems to fix it, but I don't know if this is the best way.

Another issue is that this peace of code is inside an "#ifdef WINDOWS32", but on every other ifdef like this the variable being used is WIN32. Is this right?

Michel Boaventura <michelboaventura>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #18134:  change_output_file_name.patch added by michelboaventura (1KiB - application/octet-stream)
file #18131:  default_path.patch added by jmd (2KiB - text/x-diff)
file #18130:  change_backslash_slash.patch added by michelboaventura (1KiB - application/octet-stream)
file #18128:  change_backslash_slash.patch added by michelboaventura (746B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jmd (Updated the item)
  • -unavailable- added by michelboaventura (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 13 May 2009 10:57:47 PM UTCjmdStatusReady for Test/Review=>Fixed
      Open/ClosedOpen=>Closed
    Wed 13 May 2009 04:35:51 PM UTCmichelboaventuraAttached File-=>Added change_output_file_name.patch, #18134
    Wed 13 May 2009 12:56:30 AM UTCjmdAttached File-=>Added default_path.patch, #18131
      StatusNone=>Ready for Test/Review
    Tue 12 May 2009 05:00:32 PM UTCmichelboaventuraAttached File-=>Added change_backslash_slash.patch, #18130
    Tue 12 May 2009 04:40:30 PM UTCmichelboaventuraAttached File-=>Added change_backslash_slash.patch, #18128

    Back to the top


    Powered by Savane 3.1-cleanup1