Handle newline in symlink target for bug #485226.
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Sep 2013 23:32:17 +0000 (16:32 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Sep 2013 23:32:17 +0000 (16:32 -0700)
pym/portage/dbapi/vartree.py

index cbdf75bf9af90f72b57de75990f8225ad590f2f5..ed62323f551c6cf478f58d11b9bc6164a7049866 100644 (file)
@@ -3753,6 +3753,13 @@ class dblink(object):
                                                # to an infinite recursion loop.
                                                mylinklist.append(relative_path)
 
+                                               myto = _unicode_decode(
+                                                       _os.readlink(_unicode_encode(fpath,
+                                                       encoding=_encodings['merge'], errors='strict')),
+                                                       encoding=_encodings['merge'], errors='replace')
+                                               if line_ending_re.search(myto) is not None:
+                                                       paths_with_newlines.append(relative_path)
+
                                if unicode_error:
                                        break