Bug 165338 - `basename` fails to handle path with white space
Summary: `basename` fails to handle path with white space
Alias: None
Product: Fedora
Classification: Fedora
Component: xmlto
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL: http://www.cygwin.com/ml/cygwin/2004-...
Depends On:
TreeView+ depends on / blocked
Reported: 2005-08-08 08:08 UTC by Austin Tuan
Modified: 2008-08-02 23:40 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2007-01-22 15:11:30 UTC

Attachments (Terms of Use)

Description Austin Tuan 2005-08-08 08:08:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

Description of problem:
In cygwin, it seems that command `basename` used in `xmlto` fails to handle path with white space. I do not have Fedora with me now, but the xmlto binary(script) is the same, so I assume this might also happen on Fedora.

(Below was the original email back in March. Sorry for that, I should use bugzilla instead of personal email...)
Hi Tim,
   First I would like to thank you for this nice tool. I'm very
surprised when I know that it's written in bash script!
   I would like to mention an error when using xmlto under cygwin.
It's the first time I use xmlto, and I ran into a "basename" warning.
Google search take me to some previous discussion on Cygwin List.
Please take a look at the below message, in which the 1st problem is
the same as mine:
   I'm a newbie to XML, but it seems that the modification that Elvin
Peterson suggested in the below email did solve my problem. (I copied
xmlto as xmltotest, modified as suggested, tested okay)
   Is it possible for you to adopt this change?

Austin Tuan @ Taipei, Taiwan

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Change directory so that your path include white space, such as "/cygdrive/d/My Documents/Austin Tuan/article/OpenNMS/docs/install"
2.Run `xmlto` from here, such as `xmlto html-nochunks book.xml`
3.The warning would be 
basename: extra operand `Tuan/article/OpenNMS/docs/install/book'
Try `basename --help' for more information.

Actual Results:  Still I could get the result html, but the filename would be something like "xmlto.Kk3332.html"

Expected Results:  1. Success without warnings
2. The desired filename should be "book.html" in this case

Additional info:

Comment 1 Gerwin Krist 2005-08-08 10:59:09 UTC
Target is windows and this problem is not on fedora based machines.
So closing it.


Comment 2 Tim Waugh 2005-08-08 11:29:15 UTC
No, this looks like it affects Fedora Core too.

Comment 3 Tim Waugh 2005-08-08 13:06:45 UTC
This should be fixed in xmlto-0.0.18-9 in Fedora Core devel.

I seem to have.. er.. "misplaced" the CVS repository for xmlto, so this is not
fixed upstream yet.

Comment 4 Gerwin Krist 2005-08-08 14:36:52 UTC
Sorry my bad, i tested it the other way ...

Comment 5 Christian Iseli 2007-01-22 11:09:28 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?


Note You need to log in before you can comment on or make changes to this bug.