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 authentification level.

patch #6158: Make set debuglog work

Submitted by:  Benjamin Wolsey <bwy>
Submitted on:  Mon 20 Aug 2007 08:59:56 AM UTC  
 
Category: NonePriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Sandro Santilli <strk>Open/Closed: Closed

(Jump to the original submission 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>
Project Member
Mon 20 Aug 2007 11:26:42 PM UTC, comment #10:

committed in both branches.

Sandro Santilli <strk>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
Mon 20 Aug 2007 05:15:59 PM UTC, comment #7:

Patch attached.

(file #13741)

Benjamin Wolsey <bwy>
Project 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>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project Member

 

Attached Files
file #13752:  getpwnamcheck.patch added by bwy (2kB - text/x-patch)
file #13742:  tilde_bugfix.patch added by bwy (2kB - text/x-patch)
file #13741:  expand_tilde.patch added by bwy (6kB - 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
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by bwy (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Aug 2007 11:04:35 AM UTCbwyAttached File-=>Added getpwnamcheck.patch, #13752
    Mon 20 Aug 2007 07:23:43 PM UTCbwyAttached File-=>Added tilde_bugfix.patch, #13742
    Mon 20 Aug 2007 06:09:49 PM UTCstrkStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Mon 20 Aug 2007 05:15:59 PM UTCbwyAttached File-=>Added expand_tilde.patch, #13741
    Mon 20 Aug 2007 01:28:55 PM UTCbwyAttached File-=>Added expand_tilde_on_unix_first_go.patch, #13739
    Mon 20 Aug 2007 10:42:54 AM UTCstrkStatusNone=>Ready For Test
      Assigned toNone=>strk
    Mon 20 Aug 2007 08:59:56 AM UTCbwyAttached File-=>Added make_log_work.patch, #13737

    Back to the top


    Powered by Savane 3.1-cleanup