Empty path components are equivalent to `.'.
authormdw <mdw>
Wed, 28 Jul 1999 09:31:01 +0000 (09:31 +0000)
committermdw <mdw>
Wed, 28 Jul 1999 09:31:01 +0000 (09:31 +0000)
src/become.c

index 9c1a4e1..6236855 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: become.c,v 1.20 1999/05/04 16:17:11 mdw Exp $
+ * $Id: become.c,v 1.21 1999/07/28 09:31:01 mdw Exp $
  *
  * Main code for `become'
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: become.c,v $
+ * Revision 1.21  1999/07/28 09:31:01  mdw
+ * Empty path components are equivalent to `.'.
+ *
  * Revision 1.20  1999/05/04 16:17:11  mdw
  * Change to header file name for parser.  See log for `parse.h' for
  * details.
@@ -1403,6 +1406,7 @@ done_options:
        * Bugtraq, as a complaint against sudo.]
        */
 
+      if (!*p) p = ".";
       sprintf(rq.cmd, "%s/%s", p, binary);
       if (stat(rq.cmd, &st) == 0 &&    /* Check it exists */
          st.st_mode & 0111 &&          /* Check it's executable */