On Mon, 2010-05-31 at 16:25 +0200, Jiri Moskovcak wrote:
The patch again without the po files.
J.
On 05/31/2010 04:22 PM, Jiri Moskovcak wrote:
> It's the simplest I could think of, but it has one problem:
> -> what if " (deleted)" is a real part of the path?
> - I can try to stat() the path with "(deleted)" and cut it only if it
> doesn't exist, but is it worth it? who would have "(deleted)" as part
of
> a filename?
Yeah, don't stat it. In real world, that will never came up.
+ char *deleted = strstr(executable, " (deleted)");
+ if(deleted)
+ deleted = '\0';
Maybe check that " (deleted)" is exactly at the end?
+ char *deleted = executable + strlen(executable) - strlen(" (deleted)");
+ if (deleted > executable && strcmp(deleted, " (deleted)") == 0)
+ deleted = '\0';
--
vda