fix pb with executing viewer for files with single-quotes in pathnames

This commit is contained in:
dockes
2006-12-07 07:07:35 +00:00
parent d5745bdb83
commit b9b6a871ca
4 changed files with 48 additions and 10 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.12 2006-12-05 15:23:50 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.13 2006-12-07 07:07:35 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -662,12 +662,13 @@ void RclMain::startNativeViewer(int docnum)
string fn = urltolocalpath(doc.url);
string url = url_encode(doc.url, 7);
string ipath = doc.ipath;
// Substitute %u (url) and %f (file name) inside prototype command
string ncmd;
map<char, string> subs;
subs['u'] = string("'") + url + "'";
subs['f'] = string("'") + fn + "'";
subs['u'] = escapeShell(url);
subs['f'] = escapeShell(fn);
subs['i'] = escapeShell(ipath);
pcSubst(cmd, ncmd, subs);
ncmd += " &";