<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - xdg-open open_generic_xdg_x_scheme_handler has unquoted `[ -n $scheme ]` test"
href="https://bugs.freedesktop.org/show_bug.cgi?id=109437">109437</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>xdg-open open_generic_xdg_x_scheme_handler has unquoted `[ -n $scheme ]` test
</td>
</tr>
<tr>
<th>Product</th>
<td>Portland
</td>
</tr>
<tr>
<th>Version</th>
<td>1.1.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>xdg-utils
</td>
</tr>
<tr>
<th>Assignee</th>
<td>portland-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>oldmanuk@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>xgd-open v1.1.3
A -n test doesn't work with unquoted arguments. The `$scheme` must be
double-quoted:
open_generic_xdg_x_scheme_handler()
{
scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`"
if [ -n $scheme ]; then
filetype="x-scheme-handler/$scheme"
open_generic_xdg_mime "$1" "$filetype"
fi
}
I'd suggest `if [ -n "${scheme:-}" ]; then`
Ref: <a href="https://github.com/koalaman/shellcheck/wiki/SC2070">https://github.com/koalaman/shellcheck/wiki/SC2070</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>