patchGnash - The GNU Flash player - Patches: patch #6158, Make set debuglog work

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6158: Make set debuglog work

Submitter:  Benjamin Wolsey <bwy>
Submitted:  Mon 20 Aug 2007 08:59:56 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  strk Open/Closed:  Closed

Jump to the original submission

Tue 21 Aug 2007 11:04:35 AM UTC, comment #11: 

If pwd.h found but not getpwnam it expands tilde only if HOME is set in env, the passwd part doesn't build.

It works as long as the configure tests are good.

(file #13752)

Benjamin Wolsey <bwy>
Group Member
Mon 20 Aug 2007 11:26:42 PM UTC, comment #10: 

committed in both branches.

Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 07:23:43 PM UTC, comment #9: 

Fixes a typo, matches the whole username if there's no slash (following POSIX) and makes expandPath (not expandTilde) private.

(file #13742)

Benjamin Wolsey <bwy>
Group Member
Mon 20 Aug 2007 06:09:49 PM UTC, comment #8: 

Applied in both head and 0.8.1 branch. Thanks !

Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 05:15:59 PM UTC, comment #7: 

Patch attached.

(file #13741)

Benjamin Wolsey <bwy>
Group Member
Mon 20 Aug 2007 04:29:20 PM UTC, comment #6: 

Ben, your patch works fine for me, but will commit the one with expandTilde function (missed attachment?)

Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 02:49:12 PM UTC, comment #5: 

I've just been putting it into a function expandTilde for that very reason. The first patch is there in case there are any dreadful errors in the code (like trying to modify const char ...)

It's tested with various combinations of input. It should (and does) only do anything to the path if it starts with a ~ and either has ~/ or ~recognized_user. Anything else, including non-existent user ought to return the path it gets.

libbase/log.cpp must be the place to handle write errors for non-existent directories or denied write permission.

Benjamin Wolsey <bwy>
Group Member
Mon 20 Aug 2007 02:26:13 PM UTC, comment #4: 

Another note: it was disturbing (not your fault) that when I tried ~/gnash.log I didn't get any ERROR, would have expected something like: 'ERROR: can't create ~/gnash.log: no such file or directory'


Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 02:23:24 PM UTC, comment #3: 

No, the only reason I was wondering about was for the testcase, but I used /tmp/gnash-dbg.log to avoid problems with it...
(actually, we might engage the expantion in the testcase too instead).

BTW, I think we'd really need some testing of the new code, like...
~user ~nonexistinguser ~user/dir etc.

Also, I suggest doing the expantion in a dedicated function, as it might be used for other kind of settings too in the future, as we might add more custom expansions (pid, movie url, ...)


Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 01:28:55 PM UTC, comment #2: 

Well, you asked for it...

An attempt to expand the tilde like the UNIX shell does, using HOME environment variable or pwd when that fails.

It uses ifndef HAVE_WINSOCK as a temporary measure to avoid rebuilding everything.

No reason not to do it in rc.cpp, is there? I don't think anything needs want the original value of _log.

(file #13739)

Benjamin Wolsey <bwy>
Group Member
Mon 20 Aug 2007 10:42:54 AM UTC, comment #1: 

Committed and added testing.
Note that 'set debuglog ~/gnash.log' won't work, while would be nice if it did. Dunno if it would be better to have the tilde expansion performed at logfile parse time or in the users of that variable.

Sandro Santilli <strk>
Group Member
Mon 20 Aug 2007 08:59:56 AM UTC, original submission:  

A one liner to make "set debuglog <path_to_file>" in .gnashrc work when set.

I think this is quite important, because it's been in the documentation for ages and I used to wonder why it didn't work.

Benjamin Wolsey <bwy>
Group Member

 

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

Attached Files
file #13752:  getpwnamcheck.patch added by bwy (2KiB - text/x-patch)
file #13742:  tilde_bugfix.patch added by bwy (2KiB - text/x-patch)
file #13741:  expand_tilde.patch added by bwy (6KiB - text/x-patch)
file #13737:  make_log_work.patch added by bwy (608B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bwy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-08-21 bwy Attached File- Added getpwnamcheck.patch, #13752
    2007-08-20 bwy Attached File- Added tilde_bugfix.patch, #13742
    2007-08-20 strk StatusReady For Test Done
        Open/ClosedOpen Closed
    2007-08-20 bwy Attached File- Added expand_tilde.patch, #13741
    2007-08-20 bwy Attached File- Added expand_tilde_on_unix_first_go.patch, #13739
    2007-08-20 strk StatusNone Ready For Test
        Assigned toNone strk
    2007-08-20 bwy Attached File- Added make_log_work.patch, #13737

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code