Fix string bug in project command lister

This commit is contained in:
Allen Webster 2018-12-09 14:20:00 -08:00
parent 6d193225f9
commit cb85505390
6 changed files with 2580 additions and 170 deletions

View File

@ -1,5 +1,5 @@
/*
4coder_string.h - Version 1.0.116
4coder_string.h - Version 1.0.117
no warranty implied; use at your own risk
This software is in the public domain. Where that dedication is not
@ -12,37 +12,7 @@ To use in C mode: #define FSTRING_C
// TOP
// 4tech_standard_preamble.h
#if !defined(FTECH_INTEGERS)
#define FTECH_INTEGERS
#include <stdint.h>
typedef int8_t i8_4tech;
typedef int16_t i16_4tech;
typedef int32_t i32_4tech;
typedef int64_t i64_4tech;
typedef uint8_t u8_4tech;
typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;
typedef int8_t b8_4tech;
typedef int32_t b32_4tech;
#endif
#if !defined(Assert)
# define Assert(n) do{ if (!(n)) *(int*)0 = 0xA11E; }while(0)
#endif
// standard preamble end
#if !defined(FSTRING_LINK)
# define FSTRING_LINK static
@ -2315,6 +2285,7 @@ string_push_copy(Partition *part, String str){
if (result.str != 0){
result.memory_size = str.size + 1;
copy(&result, str);
result.str[result.size] = 0;
}
return(result);
}

View File

@ -133,7 +133,9 @@ add_listener(File_Track_System *system, Partition *scratch, u8 *filename){
u8 dir_name[1024];
internal_get_parent_name(dir_name, ArrayCount(dir_name), filename);
HANDLE dir = CreateFile_utf8(dir_name, FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, 0);
HANDLE dir = CreateFile_utf8(dir_name, FILE_LIST_DIRECTORY,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, 0);
if (dir != INVALID_HANDLE_VALUE){
BY_HANDLE_FILE_INFORMATION dir_info = {};

2436
string/4coder_string.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
1
0
117
119

View File

@ -194,7 +194,7 @@ int main(){
}
// NOTE(allen): String Library
String out = str_alloc(part, 10 << 20);
String out = string_push(part, 10 << 20);
Cpp_Token *token = 0;
i32 start = 0;

View File

@ -2145,6 +2145,7 @@ DOC_RETURN(If successfull returns a string copy of str, otherwise returns a nul
if (result.str != 0){
result.memory_size = str.size + 1;
copy(&result, str);
result.str[result.size] = 0;
}
return(result);
}