Ticket #79 (closed defect)

Opened 9 years ago

Last modified 9 years ago

Patch for allowing whitespace in file names

Reported by: heiner0 Owned by:
Priority: normal Milestone:
Component: Version:
Keywords: Cc: heiner0
Blocked By: Blocks:


The attached patch fixes

[1960894] libssh2_scp_* do not handle whitespace in file names

It introduces a new (private) function


for "quoting" a shell command argument (e.g. a file name). Example:

one two

gets converted to

'one two'

(note the single quotation marks).

The quoting style ensures that the results
work with both Bourne Shell derivates (sh, ksh, ksh93, bash, zsh) and C-Shell dialects (csh, tcsh).

The new (private) macro


calculates the maximum size a quoted string can have; this is useful for allocating a memory buffer for the

I've tested the code with

Linux: bash, ksh93, tcsh
Solaris: sh, bash, csh


shellquote.patch (9.6 KB) - added by heiner0 9 years ago.
Patch for allowing whitspace in file names

Download all attachments as: .zip

Change History

Changed 9 years ago by heiner0

Patch for allowing whitspace in file names

comment:1 Changed 9 years ago by heiner0

This entry is a duplicate of 1960894 and can be close.

Note: See TracTickets for help on using tickets.