Mercurial > noffle
comparison src/configfile.c @ 134:7dfbb1c20a81 noffle
[svn] k and m suffices on filter numbers
author | bears |
---|---|
date | Wed, 16 Aug 2000 00:08:13 +0100 |
parents | 8897b7e3b108 |
children | 1c7303c71f66 |
comparison
equal
deleted
inserted
replaced
133:ffb8a4a91218 | 134:7dfbb1c20a81 |
---|---|
4 The following macros must be set, when compiling this file: | 4 The following macros must be set, when compiling this file: |
5 CONFIGFILE | 5 CONFIGFILE |
6 SPOOLDIR | 6 SPOOLDIR |
7 VERSION | 7 VERSION |
8 | 8 |
9 $Id: configfile.c 189 2000-08-09 21:19:17Z bears $ | 9 $Id: configfile.c 199 2000-08-15 23:08:13Z bears $ |
10 */ | 10 */ |
11 | 11 |
12 #if HAVE_CONFIG_H | 12 #if HAVE_CONFIG_H |
13 #include <config.h> | 13 #include <config.h> |
14 #endif | 14 #endif |
710 goto synErr; | 710 goto synErr; |
711 } | 711 } |
712 else | 712 else |
713 { | 713 { |
714 char * endVal; | 714 char * endVal; |
715 int suffix; | |
715 | 716 |
716 rule.data.amount = strtoul( value, &endVal, 0 ); | 717 rule.data.amount = strtoul( value, &endVal, 0 ); |
718 suffix = tolower( *endVal ); | |
719 if ( suffix == 'k' || suffix == 'm' ) | |
720 { | |
721 rule.data.amount *= 1024; | |
722 if ( suffix == 'm' ) | |
723 rule.data.amount *= 1024; | |
724 endVal++; | |
725 } | |
717 if ( *endVal != '\0' && ! isspace( *endVal ) ) | 726 if ( *endVal != '\0' && ! isspace( *endVal ) ) |
718 goto synErr; | 727 goto synErr; |
719 } | 728 } |
720 | 729 |
721 if ( strcmp( ruleName, "action" ) != 0 ) | 730 if ( strcmp( ruleName, "action" ) != 0 ) |