Skip to content

Commit

Permalink
Fix crash upon replacing text from clipboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Dec 17, 2023
1 parent fe17be4 commit 154c0c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions misc/distrib_win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mkdir dist/Linux/ISO
mkdir dist/Linux/OUT


declare -a langs=("nl" "ru" "en" "hi" "fr" "no" "pt_br" "uz" "pl" "cs" "id")
declare -a langs=("nl" "en")
for lang in "${langs[@]}"
do

Expand Down Expand Up @@ -102,8 +102,16 @@ cp bin/Linux/ctr$lang dist/Linux/ISO/$lang/
cp plugins/media/libctrmedia.so dist/Linux/ISO/$lang/mods/media/
rm dist/Linux/ISO/$lang/*.dll
sed -e "s/ctrnl/ctr$lang/g" plugins/media/assets/citrine.sh > dist/Linux/ISO/$lang/citrine.sh
sed -e "s/ctrnl/ctrapp_$lang/g" plugins/media/assets/citrine.sh > dist/Linux/ISO/$lang/citrine_app.sh
chmod uog+x dist/Linux/ISO/$lang/citrine.sh
chmod uog+x dist/Linux/ISO/$lang/citrine_app.sh

tar cvzf "dist/Linux/OUT/$lang/citrine${lang}096.tar.gz" -C dist/Linux/ISO/$lang/ .
# Create Linux AppImage distribution
rm -rf /tmp/Citrine.AppDir
cp -r misc/Citrine.AppDir /tmp/
cp dist/Linux/ISO/${lang}/ctr${lang} /tmp/Citrine.AppDir/
./appimagetool-x86_64.AppImage /tmp/Citrine.AppDir citrine_app ; cp citrine_app dist/Linux/ISO/nl/ctrapp_${lang}
chmod uog+x dist/Linux/ISO/nl/ctrapp_${lang}

tar cvzf "dist/Linux/OUT/$lang/citrine${lang}096.tar.gz" -C dist/Linux/ISO/$lang/ .
done
2 changes: 1 addition & 1 deletion plugins/media/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void ctr_internal_media_textinsert(MediaIMG* mediaImage, char* text) {
}
mediaImage->textlength = mediaImage->textlength + insertTextLength;
if (mediaImage->textlength+1 > mediaImage->textbuffer) {
mediaImage->textbuffer = (mediaImage->textbuffer) ? mediaImage->textbuffer * 2 : 1;
mediaImage->textbuffer = mediaImage->textlength + 500;
mediaImage->text = ctr_heap_reallocate(mediaImage->text, mediaImage->textbuffer + 1);
}
memcpy(mediaImage->text+CtrMediaInputIndex+insertTextLength, mediaImage->text+CtrMediaInputIndex,mediaImage->textlength-CtrMediaInputIndex-insertTextLength);
Expand Down

0 comments on commit 154c0c5

Please sign in to comment.