Author: dagolden
Date: Mon Jun 22 13:51:13 2009
New Revision: 12881

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Platform/Unix.pm

Log:
more liberal username chars with tilde on Unix (RT#33492)

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Mon Jun 22 13:51:13 2009
@@ -15,6 +15,8 @@
  - include_dirs parameter now works correctly when given a single
    string argument (RT#40177)
  - Lots of spelling fixes in the POD (RT#45528)
+ - On Unix-like systems, tilde expansion is more liberal in username
+   characters accepted (RT#33492)
 
  Other
  - On MSWin32, bumped File::Spec prereq to 3.30 for a variety of fixes

Modified: Module-Build/trunk/lib/Module/Build/Platform/Unix.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Platform/Unix.pm        (original)
+++ Module-Build/trunk/lib/Module/Build/Platform/Unix.pm        Mon Jun 22 
13:51:13 2009
@@ -35,9 +35,13 @@
   return $self;
 }
 
+# Open group says username should be portable filename characters,
+# but some Unix OS working with ActiveDirectory wind up with user-names
+# with back-slashes in the name.  The new code below is very liberal
+# in what it accepts.
 sub _detildefy {
   my ($self, $value) = @_;
-  $value =~ s[^~(\w[-\w]*)?(?=/|$)]   # tilde with optional username
+  $value =~ s[^~([^/]+)?(?=/|$)]   # tilde with optional username
     [$1 ?
      ((getpwnam $1)[7] || "~$1") :
      ($ENV{HOME} || (getpwuid $>)[7])

Reply via email to