Skip to content

Commit 0a2fe06

Browse files
committed
Merge pull request #118 from fourpastmidnight/feature/UpdateGitBashStringResourceEditor
Feature/update git bash string resource editor
2 parents 34b7bc0 + 8710041 commit 0a2fe06

7 files changed

+28
-17
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
*.swp
2+
edit-git-bash.dll
3+
edit-git-bash.exe
24
/cached-source-packages/
35
/download-stats.ids
46
/git-extra/pkg/
@@ -7,7 +9,6 @@
79
/installer/ReleaseNotes.html
810
/installer/bindimage.txt
911
/installer/config.iss
10-
/installer/edit-git-bash.exe
1112
/installer/install.log
1213
/installer/is-unicode.exe
1314
/installer/file-list.iss

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CFLAGS=-O2 -Wall
2+
DLLINKFLAGS=-Wl,--kill-at -static-libgcc -shared
3+
4+
all: edit-git-bash.dll
5+
6+
# InnoSetup always uses the DLL target, and it must always be 32-bit
7+
# because InnoSetup is only 32-bit aware.
8+
edit-git-bash.dll: edit-git-bash.c
9+
PATH=/mingw32/bin:$$PATH \
10+
i686-w64-mingw32-gcc -march=i686 $(CFLAGS) $(DLLINKFLAGS) -o $@ $^
11+
12+
edit-git-bash.exe: edit-git-bash.c
13+
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^

installer/edit-git-bash.c edit-git-bash.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,22 @@ int edit_git_bash(LPWSTR git_bash_path, LPWSTR new_command_line)
4949
len = wcslen(new_command_line);
5050
alloc = 2 * (len + 16);
5151
buffer = calloc(alloc, 1);
52+
5253
if (!buffer)
5354
return 1;
55+
5456
buffer[0] = (WCHAR) len;
5557
memcpy(buffer + 1, new_command_line, 2 * len);
5658

5759
if (!(handle = BeginUpdateResource(git_bash_path, FALSE)))
5860
return 2;
5961

60-
if (!UpdateResource(handle, RT_STRING, MAKEINTRESOURCE(1),
61-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
62+
if (!UpdateResource(handle, RT_STRING, MAKEINTRESOURCE(1),
63+
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
6264
buffer, alloc))
6365
result = 3;
64-
if (!EndUpdateResource(handle, FALSE))
66+
67+
if (!EndUpdateResource(handle, FALSE))
6568
return 4;
6669

6770
return result;

installer/Makefile

-10
This file was deleted.

installer/edit-git-bash.dll

-80.2 KB
Binary file not shown.

installer/install.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Filename: {app}\ReleaseNotes.html; Description: View Release Notes; Flags: shell
105105
Source: {#SourcePath}\ReleaseNotes.html; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
106106
Source: {#SourcePath}\LICENSE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
107107
Source: {#SourcePath}\NOTICE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore; Check: ParamIsSet('VSNOTICE')
108-
Source: {#SourcePath}\edit-git-bash.dll; Flags: dontcopy
108+
Source: {#SourcePath}\..\edit-git-bash.dll; Flags: dontcopy
109109

110110
[Dirs]
111111
Name: "{app}\tmp"

installer/release.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ case "$version" in
5151
*) die "InnoSetup requires a version that begins with a digit";;
5252
esac
5353

54-
../render-release-notes.sh --css usr/share/git/
55-
5654
# Evaluate architecture
5755
ARCH="$(uname -m)"
5856

@@ -68,6 +66,12 @@ x86_64)
6866
;;
6967
esac
7068

69+
echo "Generating release notes to be included in the installer ..."
70+
../render-release-notes.sh --css usr/share/git/
71+
72+
echo "Compiling edit-git-bash.dll ..."
73+
make -C ../ edit-git-bash.dll
74+
7175
if test t = "$skip_files"
7276
then
7377
LIST=

0 commit comments

Comments
 (0)