Commit c4e656c6 c4e656c6b527f269f7665ffe7fa65a94c2c55be8 by Sergey Poznyakoff

(locker_lock): Allow for non-absolute file names.

1 parent eea4f28c
......@@ -425,9 +425,15 @@ locker_lock (locker_t lock)
strcpy (tmp, lock->file);
p = strrchr (tmp, '/');
/* A '/' must be present, if not we'll coredump, and that's
correct! */
*p = 0;
if (!p)
{
free (tmp);
tmp = strdup (".");
if (!tmp)
return ENOMEM;
}
else
*p = 0;
if (access (tmp, W_OK))
{
......