Skip to content

Commit ad5c80b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents ad804ed + 1b9a1e5 commit ad5c80b

File tree

7 files changed

+98
-91
lines changed

7 files changed

+98
-91
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
build:
3131
name: Build Project
3232
runs-on: windows-latest
33-
33+
permissions:
34+
contents: write
35+
discussions: write
3436
steps:
3537
- name: Check out repository code (Action from GitHub)
3638
uses: actions/checkout@v3

.github/workflows/codeql.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
#
44
# You may wish to alter this file to override the set of languages analyzed,
55
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
6+
127
name: "CodeQL"
138

149
on:
1510
push:
1611
branches: [ "master" ]
12+
paths-ignore:
13+
- '**/*.md'
14+
- '**/*.txt'
15+
- '.github/**'
16+
- '**/.gitignore'
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "master" ]
20+
paths-ignore:
21+
- '**/*.md'
22+
- '**/*.txt'
23+
- '.github/**'
24+
- '**/.gitignore'
2025
schedule:
2126
- cron: '30 19 * * 0'
2227

.github/workflows/tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ on:
44
push:
55
branches:
66
- master
7+
paths-ignore:
8+
- '**/*.md'
9+
- '**/*.txt'
10+
- '.github/**'
11+
- '**/.gitignore'
712
pull_request:
813
branches:
914
- master
15+
paths-ignore:
16+
- '**/*.md'
17+
- '**/*.txt'
18+
- '.github/**'
19+
- '**/.gitignore'
1020

1121
defaults:
1222
run:

SECURITY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 1.3.x | :white_check_mark: |
8+
| < 1.3 ||
9+
10+
## Reporting a Vulnerability
11+
12+
If you discover a security issue in our project, please report it to [MartiUK](https://github.com/MartiUK). We will acknowledge your email within 24 hours and provide a more detailed response within 48 hours. We will try to fix the issue as soon as possible and inform you when a new version is released.
13+
14+
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
15+
16+
- The nature of the issue
17+
- The affected source file(s) with full paths
18+
- The location of the vulnerable code (tag/branch/commit or direct URL)
19+
- Any special configuration needed to reproduce the issue
20+
- Detailed steps to reproduce the issue
21+
- Proof-of-concept or exploit code (if possible)
22+
- The impact of the issue, including how an attacker could exploit it
23+
24+
Please do not disclose the vulnerability publicly until we have resolved it.

appveyor.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

vendor/clink.lua

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,37 @@ local function get_unknown_color()
5151
end
5252

5353
---
54-
-- Makes a string safe to use as the replacement in string.gsub
54+
-- Escapes special characters in a string.gsub `find` parameter, so that it
55+
-- can be matched as a literal plain text string, i.e. disable Lua pattern
56+
-- matching. See "Patterns" (https://www.lua.org/manual/5.2/manual.html#6.4.1).
57+
-- @param {string} text Text to escape
58+
-- @returns {string} Escaped text
5559
---
56-
local function verbatim(s)
57-
s = string.gsub(s, "%%", "%%%%")
58-
return s
60+
local function escape_gsub_find_arg(text)
61+
return text and text:gsub("([-+*?.%%()%[%]$^])", "%%%1") or ""
62+
end
63+
64+
---
65+
-- Escapes special characters in a string.gsub `replace` parameter, so that it
66+
-- can be replaced as a literal plain text string, i.e. disable Lua pattern
67+
-- matching. See "Patterns" (https://www.lua.org/manual/5.2/manual.html#6.4.1).
68+
-- @param {string} text Text to escape
69+
-- @returns {string} Escaped text
70+
---
71+
local function escape_gsub_replace_arg(text)
72+
return text and text:gsub("%%", "%%%%") or ""
73+
end
74+
75+
---
76+
-- Perform string.sub, but disable Lua pattern matching and just treat both
77+
-- the `find` and `replace` parameters as a literal plain text replacement.
78+
-- @param {string} str Text in which to perform find and replace
79+
-- @param {string} find Text to find (plain text; not a Lua pattern)
80+
-- @param {string} replace Replacement text (plain text; not a Lua pattern)
81+
-- @returns {string} Copy of the input `str` with `find` replaced by `replace`
82+
---
83+
local function gsub_plain(str, find, replace)
84+
return string.gsub(str, escape_gsub_find_arg(find), escape_gsub_replace_arg(replace))
5985
end
6086

6187
-- Extracts only the folder name from the input Path
@@ -153,7 +179,7 @@ local function set_prompt_filter()
153179
end
154180

155181
if prompt_useHomeSymbol and string.find(cwd, clink.get_env("HOME")) then
156-
cwd = string.gsub(cwd, clink.get_env("HOME"), prompt_homeSymbol)
182+
cwd = gsub_plain(cwd, clink.get_env("HOME"), prompt_homeSymbol)
157183
end
158184

159185
local uah = ''
@@ -176,14 +202,14 @@ local function set_prompt_filter()
176202
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
177203

178204
local prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
179-
prompt = string.gsub(prompt, "{uah}", uah)
180-
prompt = string.gsub(prompt, "{cwd}", cwd)
181-
prompt = string.gsub(prompt, "{env}", env)
182-
clink.prompt.value = string.gsub(prompt, "{lamb}", prompt_lambSymbol)
205+
prompt = gsub_plain(prompt, "{uah}", uah)
206+
prompt = gsub_plain(prompt, "{cwd}", cwd)
207+
prompt = gsub_plain(prompt, "{env}", env)
208+
clink.prompt.value = gsub_plain(prompt, "{lamb}", prompt_lambSymbol)
183209
end
184210

185211
local function percent_prompt_filter()
186-
clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%")
212+
clink.prompt.value = gsub_plain(clink.prompt.value, "{percent}", "%")
187213
end
188214

189215
---
@@ -532,13 +558,13 @@ local function git_prompt_filter()
532558
color = colors.conflict
533559
end
534560

535-
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", " "..color.."("..verbatim(branch)..")")
561+
clink.prompt.value = gsub_plain(clink.prompt.value, "{git}", " "..color.."("..branch..")")
536562
return false
537563
end
538564
end
539565

540566
-- No git present or not in git file
541-
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
567+
clink.prompt.value = gsub_plain(clink.prompt.value, "{git}", "")
542568
return false
543569
end
544570

@@ -577,13 +603,13 @@ local function hg_prompt_filter()
577603
end
578604

579605
local result = color .. "(" .. branch .. ")"
580-
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", " "..verbatim(result))
606+
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", " "..result)
581607
return false
582608
end
583609
end
584610

585611
-- No hg present or not in hg repo
586-
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
612+
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", "")
587613
end
588614

589615
local function svn_prompt_filter()
@@ -636,13 +662,13 @@ local function svn_prompt_filter()
636662
color = colors.dirty
637663
end
638664

639-
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", " "..color.."("..verbatim(branch)..")")
665+
clink.prompt.value = gsub_plain(clink.prompt.value, "{svn}", " "..color.."("..branch..")")
640666
return false
641667
end
642668
end
643669

644670
-- No svn present or not in svn file
645-
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", "")
671+
clink.prompt.value = gsub_plain(clink.prompt.value, "{svn}", "")
646672
return false
647673
end
648674

vendor/sources.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[
22
{
33
"name": "git-for-windows",
4-
"version": "2.40.1.windows.1",
5-
"url": "https://github.com/git-for-windows/git/releases/download/v2.40.1.windows.1/PortableGit-2.40.1-64-bit.7z.exe"
4+
"version": "2.41.0.windows.3",
5+
"url": "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/PortableGit-2.41.0.3-64-bit.7z.exe"
66
},
77
{
88
"name": "clink",
9-
"version": "1.4.24",
10-
"url": "https://github.com/chrisant996/clink/releases/download/v1.4.24/clink.1.4.24.688975.zip"
9+
"version": "1.5.1",
10+
"url": "https://github.com/chrisant996/clink/releases/download/v1.5.1/clink.1.5.1.1e9e51.zip"
1111
},
1212
{
1313
"name": "conemu-maximus5",
14-
"version": "22.12.18",
15-
"url": "https://github.com/Maximus5/ConEmu/releases/download/v22.12.18/ConEmuPack.221218.7z"
14+
"version": "23.07.24",
15+
"url": "https://github.com/Maximus5/ConEmu/releases/download/v23.07.24/ConEmuPack.230724.7z"
1616
},
1717
{
1818
"name": "clink-completions",
19-
"version": "0.4.8",
20-
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.8.zip"
19+
"version": "0.4.10",
20+
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.10.zip"
2121
}
2222
]

0 commit comments

Comments
 (0)