Commit c4e656c6 c4e656c6b527f269f7665ffe7fa65a94c2c55be8 by Sergey Poznyakoff

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

1 parent eea4f28c
...@@ -425,8 +425,14 @@ locker_lock (locker_t lock) ...@@ -425,8 +425,14 @@ locker_lock (locker_t lock)
425 425
426 strcpy (tmp, lock->file); 426 strcpy (tmp, lock->file);
427 p = strrchr (tmp, '/'); 427 p = strrchr (tmp, '/');
428 /* A '/' must be present, if not we'll coredump, and that's 428 if (!p)
429 correct! */ 429 {
430 free (tmp);
431 tmp = strdup (".");
432 if (!tmp)
433 return ENOMEM;
434 }
435 else
430 *p = 0; 436 *p = 0;
431 437
432 if (access (tmp, W_OK)) 438 if (access (tmp, W_OK))
......