Silence some byte-compiler warnings in ERC
[bpt/emacs.git] / src / filelock.c
index 84540f7..4c211bf 100644 (file)
@@ -1,12 +1,12 @@
 /* Lock files for editing.
-   Copyright (C) 1985, 86, 87, 93, 94, 96, 98, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
+                 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -16,8 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 
 #include <config.h>
@@ -26,11 +26,9 @@ Boston, MA 02111-1307, USA.  */
 #include <signal.h>
 #include <stdio.h>
 
-#ifdef VMS
-#include "vms-pwd.h"
-#else
+#ifdef HAVE_PWD_H
 #include <pwd.h>
-#endif /* not VMS */
+#endif
 
 #include <sys/file.h>
 #ifdef HAVE_FCNTL_H
@@ -470,8 +468,8 @@ current_lock_owner (owner, lfname)
     }
 
   /* Parse USER@HOST.PID:BOOT_TIME.  If can't parse, return -1.  */
-  /* The USER is everything before the first @.  */
-  at = index (lfinfo, '@');
+  /* The USER is everything before the last @.  */
+  at = rindex (lfinfo, '@');
   dot = rindex (lfinfo, '.');
   if (!at || !dot)
     {