Skip to content

Commit

Permalink
parseDerivation(): Fix warning about uninitialized 'version' variable
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Nov 3, 2023
1 parent e9a857e commit 55dd124
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libstore/derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Derivation parseDerivation(
expect(str, "erive(");
version = DerivationATermVersion::Traditional;
break;
case 'r':
case 'r': {
expect(str, "rvWithVersion(");
auto versionS = parseString(str);
if (versionS == "xp-dyn-drv") {
Expand All @@ -365,6 +365,9 @@ Derivation parseDerivation(
expect(str, ",");
break;
}
default:
throw Error("derivation does not start with 'Derive' or 'DrvWithVersion'");
}

/* Parse the list of outputs. */
expect(str, "[");
Expand Down

0 comments on commit 55dd124

Please sign in to comment.