biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / editors / jupyter-kernels / xeus-cling / 0001-Fix-bug-in-extract_filename.patch
blobdac0825b01a10c0281e78e47e2fa43fbdc89c537
1 From 8bfa594bc37630956f80496106bb1d6070035570 Mon Sep 17 00:00:00 2001
2 From: thomasjm <tom@codedown.io>
3 Date: Wed, 2 Aug 2023 18:26:58 -0700
4 Subject: [PATCH 1/3] Fix bug in extract_filename
6 ---
7 src/main.cpp | 12 ++++++------
8 1 file changed, 6 insertions(+), 6 deletions(-)
10 diff --git a/src/main.cpp b/src/main.cpp
11 index 2ee19be..57294b4 100644
12 --- a/src/main.cpp
13 +++ b/src/main.cpp
14 @@ -61,19 +61,19 @@ bool should_print_version(int argc, char* argv[])
15 return false;
18 -std::string extract_filename(int argc, char* argv[])
19 +std::string extract_filename(int *argc, char* argv[])
21 std::string res = "";
22 - for (int i = 0; i < argc; ++i)
23 + for (int i = 0; i < *argc; ++i)
25 - if ((std::string(argv[i]) == "-f") && (i + 1 < argc))
26 + if ((std::string(argv[i]) == "-f") && (i + 1 < *argc))
28 res = argv[i + 1];
29 - for (int j = i; j < argc - 2; ++j)
30 + for (int j = i; j < *argc - 2; ++j)
32 argv[j] = argv[j + 2];
34 - argc -= 2;
35 + *argc -= 2;
36 break;
39 @@ -128,7 +128,7 @@ int main(int argc, char* argv[])
40 #endif
41 signal(SIGINT, stop_handler);
43 - std::string file_name = extract_filename(argc, argv);
44 + std::string file_name = extract_filename(&argc, argv);
46 interpreter_ptr interpreter = build_interpreter(argc, argv);
48 --
49 2.40.1