Enlightenment CVS committal Author : mekius Project : e17 Module : proto
Dir : e17/proto/empower/src/bin/ewl Modified Files: Empower.h empower.c Log Message: Do a regexp check for empower-askpass instead of just checking for it. =================================================================== RCS file: /cvs/e/e17/proto/empower/src/bin/ewl/Empower.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- Empower.h 1 Jun 2007 04:20:09 -0000 1.10 +++ Empower.h 2 Jun 2007 17:16:28 -0000 1.11 @@ -7,6 +7,7 @@ #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> +#include <regex.h> #include <pwd.h> #include "Ecore_X.h" #include "Ewl.h" =================================================================== RCS file: /cvs/e/e17/proto/empower/src/bin/ewl/empower.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- empower.c 1 Jun 2007 04:20:09 -0000 1.6 +++ empower.c 2 Jun 2007 17:16:28 -0000 1.7 @@ -2,10 +2,16 @@ void parse_options(int argc, char** argv) { - /*FIXME: Parse options here so we can properly handle everything*/ + regex_t regexp; + + if(regcomp(®exp, "empower-askpass", 0)) + { + printf("Failed to create regular expression\n"); + return; + } /*Do initial mode guessing based on executable name and number of args*/ - if(!strcmp(*argv,"empower-askpass") || !strcmp(*argv,"./empower-askpass")) + if(!regexec (®exp, *argv, 0, NULL, 0)) mode = PASS; else if(argc > 1) mode = SUDO; ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs