repo.or.cz
/
hband-tools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
make getpeername() return the original socket address which before it was intercepted
[hband-tools.git]
/
user-tools
/
g_filename_to_uri
blob
487daff720468159e888cf40a7cf2c809e7cfa86
1
#!/bin/bash
2
3
true
<<EOF
4
=pod
5
6
=head1 NAME
7
8
g_filename_to_uri - Mimic g_filename_to_uri() GLib function creating a file:// url from path string
9
10
=cut
11
12
EOF
13
14
15
echo -n
file
://
$1
| \
16
perl
-pe
's{[^a-z0-9_!$~
\x26
-
\x2E
:@=+/]}{sprintf "%%%02X", ord$&}egi'