mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-20 20:49:17 -05:00
Compare commits
2 Commits
6986183858
...
4c71625730
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c71625730 | |||
| 3568b6e293 |
6
.github/workflows/build_android.yml
vendored
6
.github/workflows/build_android.yml
vendored
@ -84,8 +84,10 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
6
.github/workflows/build_linux.yml
vendored
6
.github/workflows/build_linux.yml
vendored
@ -114,8 +114,10 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
6
.github/workflows/build_macos.yml
vendored
6
.github/workflows/build_macos.yml
vendored
@ -101,8 +101,10 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
6
.github/workflows/build_webassembly.yml
vendored
6
.github/workflows/build_webassembly.yml
vendored
@ -71,8 +71,10 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
6
.github/workflows/build_windows.yml
vendored
6
.github/workflows/build_windows.yml
vendored
@ -142,8 +142,10 @@ jobs:
|
|||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
24
src/rtext.c
24
src/rtext.c
@ -1727,14 +1727,15 @@ char *GetTextBetween(const char *text, const char *begin, const char *end)
|
|||||||
|
|
||||||
// Replace text string
|
// Replace text string
|
||||||
// REQUIRES: strstr(), strncpy()
|
// REQUIRES: strstr(), strncpy()
|
||||||
// TODO: If (replacement == "") remove "search" text
|
|
||||||
// WARNING: Allocated memory must be manually freed
|
// WARNING: Allocated memory must be manually freed
|
||||||
char *TextReplace(const char *text, const char *search, const char *replacement)
|
char *TextReplace(const char *text, const char *search, const char *replacement)
|
||||||
{
|
{
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
|
|
||||||
if ((text != NULL) && (search != NULL))
|
if ((text != NULL) && (search != NULL))
|
||||||
{
|
{
|
||||||
|
if (replacement == NULL) replacement = "";
|
||||||
|
|
||||||
char *insertPoint = NULL; // Next insert point
|
char *insertPoint = NULL; // Next insert point
|
||||||
char *temp = NULL; // Temp pointer
|
char *temp = NULL; // Temp pointer
|
||||||
int textLen = 0; // Text string length
|
int textLen = 0; // Text string length
|
||||||
@ -1767,16 +1768,15 @@ char *TextReplace(const char *text, const char *search, const char *replacement)
|
|||||||
{
|
{
|
||||||
insertPoint = (char *)strstr(text, search);
|
insertPoint = (char *)strstr(text, search);
|
||||||
lastReplacePos = (int)(insertPoint - text);
|
lastReplacePos = (int)(insertPoint - text);
|
||||||
|
|
||||||
// TODO: Review logic to avoid strcpy()
|
memcpy(temp, text, lastReplacePos);
|
||||||
// OK - Those lines work
|
temp += lastReplacePos;
|
||||||
temp = strncpy(temp, text, lastReplacePos) + lastReplacePos;
|
|
||||||
temp = strcpy(temp, replacement) + replaceLen;
|
if (replaceLen > 0)
|
||||||
// WRONG - But not those ones
|
{
|
||||||
//temp = strncpy(temp, text, tempLen - 1) + lastReplacePos;
|
memcpy(temp, replacement, replaceLen);
|
||||||
//tempLen -= lastReplacePos;
|
temp += replaceLen;
|
||||||
//temp = strncpy(temp, replacement, tempLen - 1) + replaceLen;
|
}
|
||||||
//tempLen -= replaceLen;
|
|
||||||
|
|
||||||
text += lastReplacePos + searchLen; // Move to next "end of replace"
|
text += lastReplacePos + searchLen; // Move to next "end of replace"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user