|
| 1 | +--- src/qxl_option_helpers.c.orig 2015-10-12 16:31:14 UTC |
| 2 | ++++ src/qxl_option_helpers.c |
| 3 | +@@ -10,31 +10,32 @@ |
| 4 | + |
| 5 | + #include "qxl_option_helpers.h" |
| 6 | + |
| 7 | +-int get_int_option(OptionInfoPtr options, int option_index, |
| 8 | ++int get_int_option(OptionInfoPtr options, int token, |
| 9 | + const char *env_name) |
| 10 | + { |
| 11 | ++ int value; |
| 12 | + if (env_name && getenv(env_name)) { |
| 13 | + return atoi(getenv(env_name)); |
| 14 | + } |
| 15 | +- return options[option_index].value.num; |
| 16 | ++ return xf86GetOptValInteger(options, token, &value) ? value : 0; |
| 17 | + } |
| 18 | + |
| 19 | +-const char *get_str_option(OptionInfoPtr options, int option_index, |
| 20 | ++const char *get_str_option(OptionInfoPtr options, int token, |
| 21 | + const char *env_name) |
| 22 | + { |
| 23 | + if (getenv(env_name)) { |
| 24 | + return getenv(env_name); |
| 25 | + } |
| 26 | +- return options[option_index].value.str; |
| 27 | ++ return xf86GetOptValString(options, token); |
| 28 | + } |
| 29 | + |
| 30 | +-int get_bool_option(OptionInfoPtr options, int option_index, |
| 31 | ++int get_bool_option(OptionInfoPtr options, int token, |
| 32 | + const char *env_name) |
| 33 | + { |
| 34 | + const char* value = getenv(env_name); |
| 35 | + |
| 36 | + if (!value) { |
| 37 | +- return options[option_index].value.bool; |
| 38 | ++ return xf86ReturnOptValBool(options, token, FALSE); |
| 39 | + } |
| 40 | + if (strcmp(value, "0") == 0 || |
| 41 | + strcasecmp(value, "off") == 0 || |
0 commit comments