From: Joshua Kwan Date: Mon, 5 Jan 2004 02:58:48 +0000 (+0000) Subject: fix number handling X-Git-Tag: v1.6.1-roc-dev~613 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=29660313195ffdf58cbad4f29e7870900c675f15;p=dgamelaunch fix number handling git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@85 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/config.l b/config.l index 1ffcbb6..c4b1de6 100644 --- a/config.l +++ b/config.l @@ -20,6 +20,7 @@ static void ccomment(void); %} +NUMBER [0-9]+ VALUE \".*\" MALSTRING \"[^\"\n]*\n WHITE [\t ]* @@ -28,6 +29,7 @@ LONGCOMMENT "/*" %% /* BEGIN RULES SECTION */ +{NUMBER} { yylval.i = atoi(yytext); } {VALUE} { yytext[yyleng - 1] = '\0'; /* Kill the trailing quote */ yytext++; /* Kill the leading quote */ diff --git a/config.y b/config.y index 028fb00..3d60ed7 100644 --- a/config.y +++ b/config.y @@ -108,7 +108,7 @@ KeyPair: KeyType '=' TYPE_VALUE { switch ($1) { case TYPE_SUID: - if (getpwuid($3) != NULL) + if (!myconfig->shed_user && getpwuid($3) != NULL) myconfig->shed_uid = $3; else fprintf(stderr, "%s: no such uid %lu\n", config, $3); @@ -116,7 +116,7 @@ KeyPair: KeyType '=' TYPE_VALUE { break; case TYPE_SGID: - if (getgrgid($3) != NULL) + if (!myconfig->shed_group && getgrgid($3) != NULL) myconfig->shed_gid = $3; else fprintf(stderr, "%s: no such gid %lu\n", config, $3);