diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2021-03-16 22:34:57 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2021-03-17 12:03:23 +0100 |
| commit | bc3896db25c788c181c7bcd65754e7cd378e9d9f (patch) | |
| tree | f5090474db857fa4376d69d27a6425f8cb4ac5b9 /nix | |
| parent | f194fbf50eecc9f38045520db0d1a719175172ae (diff) | |
daemon: Correctly handle '--discover' with no value.
Previously, we'd get:
$ guix-daemon --discover
error: basic_string::_M_construct null not valid
* nix/nix-daemon/guix-daemon.cc (parse_opt): Change second argument to
'settings.set' to properly handle case where ARG is NULL.
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/nix-daemon/guix-daemon.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index 30d0e5d11d8..36a06a3fae6 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* GNU Guix --- Functional package management for GNU | 1 | /* GNU Guix --- Functional package management for GNU |
| 2 | Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> | 2 | Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org> |
| 3 | Copyright (C) 2006, 2010, 2012, 2014 Eelco Dolstra <e.dolstra@tudelft.nl> | 3 | Copyright (C) 2006, 2010, 2012, 2014 Eelco Dolstra <e.dolstra@tudelft.nl> |
| 4 | 4 | ||
| 5 | This file is part of GNU Guix. | 5 | This file is part of GNU Guix. |
| @@ -268,7 +268,7 @@ parse_opt (int key, char *arg, struct argp_state *state) | |||
| 268 | break; | 268 | break; |
| 269 | case GUIX_OPT_DISCOVER: | 269 | case GUIX_OPT_DISCOVER: |
| 270 | useDiscover = string_to_bool (arg); | 270 | useDiscover = string_to_bool (arg); |
| 271 | settings.set("discover", arg); | 271 | settings.set ("discover", useDiscover ? "true" : "false"); |
| 272 | break; | 272 | break; |
| 273 | case GUIX_OPT_DEBUG: | 273 | case GUIX_OPT_DEBUG: |
| 274 | verbosity = lvlDebug; | 274 | verbosity = lvlDebug; |
