Bug#507956: findimagedupes: Use of glob means folders with whitespace in their names are dropped

Jonathan H N Chin code at jhnc.org
Mon Dec 8 09:45:50 UTC 2008


I think it suffices to escape the input: glob("\Q$file\E/*")

$ find .|od -c
0000000   .  \0   .   /   t   h   i   s   '       i   s       '   a    
0000020   t   e   s   t   f   i   d  \0   .   /   t   h   i   s   '    
0000040   i   s       '   a       t   e   s   t   f   i   d   /   w   i
0000060   b   l   e   *       h   e   l   l   o  \0   .   /   t   h   i
0000100   s   '       i   s       '   a       t   e   s   t   f   i   d
0000120   /   w   i   b   l   e   *       h   e   l   l   o   /   f   o
0000140   o   b       q   u   x  \n   h   e   l   l   o  \0   .   /   t
0000160   h   i   s   '       i   s       '   a       t   e   s   t   f
0000200   i   d   /   w   i   b   l   e   *       h   e   l   l   o   /
0000220   f   o   o   b       q   u   x  \n   h   e   l   l   o   /   b
0000240   a   r  \0
0000243

$ perl -e 'sub _{($f)=@_;print"$f\0";map{_($_)}glob("\Q$f\E/*")}_(".")'|od -c
0000000   .  \0   .   /   t   h   i   s   '       i   s       '   a    
0000020   t   e   s   t   f   i   d  \0   .   /   t   h   i   s   '    
0000040   i   s       '   a       t   e   s   t   f   i   d   /   w   i
0000060   b   l   e   *       h   e   l   l   o  \0   .   /   t   h   i
0000100   s   '       i   s       '   a       t   e   s   t   f   i   d
0000120   /   w   i   b   l   e   *       h   e   l   l   o   /   f   o
0000140   o   b       q   u   x  \n   h   e   l   l   o  \0   .   /   t
0000160   h   i   s   '       i   s       '   a       t   e   s   t   f
0000200   i   d   /   w   i   b   l   e   *       h   e   l   l   o   /
0000220   f   o   o   b       q   u   x  \n   h   e   l   l   o   /   b
0000240   a   r  \0
0000243

I have uploaded a new version with the fix.


-jonathan






More information about the debian-science-maintainers mailing list