mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Fork no longer appends its merge delimiter to the end of the output. Closes #692
This commit is contained in:
parent
61d40b5a0b
commit
3e3322e1f0
3 changed files with 6 additions and 6 deletions
|
@ -76,8 +76,8 @@ class Fork extends Operation {
|
||||||
}
|
}
|
||||||
|
|
||||||
const recipe = new Recipe();
|
const recipe = new Recipe();
|
||||||
let output = "",
|
const outputs = [];
|
||||||
progress = 0;
|
let progress = 0;
|
||||||
|
|
||||||
state.forkOffset += state.progress + 1;
|
state.forkOffset += state.progress + 1;
|
||||||
|
|
||||||
|
@ -104,10 +104,10 @@ class Fork extends Operation {
|
||||||
}
|
}
|
||||||
progress = err.progress + 1;
|
progress = err.progress + 1;
|
||||||
}
|
}
|
||||||
output += await dish.get(outputType) + mergeDelim;
|
outputs.push(await dish.get(outputType));
|
||||||
}
|
}
|
||||||
|
|
||||||
state.dish.set(output, outputType);
|
state.dish.set(outputs.join(mergeDelim), outputType);
|
||||||
state.progress += progress;
|
state.progress += progress;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ TestRegister.addTests([
|
||||||
{
|
{
|
||||||
name: "Fork, Comment, Base64",
|
name: "Fork, Comment, Base64",
|
||||||
input: "cat\nsat\nmat",
|
input: "cat\nsat\nmat",
|
||||||
expectedOutput: "Y2F0\nc2F0\nbWF0\n",
|
expectedOutput: "Y2F0\nc2F0\nbWF0",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
"op": "Fork",
|
"op": "Fork",
|
||||||
|
|
|
@ -57,7 +57,7 @@ TestRegister.addTests([
|
||||||
{
|
{
|
||||||
name: "Fork, Conditional Jump, Encodings",
|
name: "Fork, Conditional Jump, Encodings",
|
||||||
input: "Some data with a 1 in it\nSome data with a 2 in it",
|
input: "Some data with a 1 in it\nSome data with a 2 in it",
|
||||||
expectedOutput: "U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74\n",
|
expectedOutput: "U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{"op": "Fork", "args": ["\\n", "\\n", false]},
|
{"op": "Fork", "args": ["\\n", "\\n", false]},
|
||||||
{"op": "Conditional Jump", "args": ["1", false, "skipReturn", "10"]},
|
{"op": "Conditional Jump", "args": ["1", false, "skipReturn", "10"]},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue