<commit_before>#include "FatFilename.h"
#include <string>

using namespace std;

// Offset of letters position in a special "long file name" entry
static unsigned char longFilePos[] = {
    30, 28, 24, 22, 20, 18, 16, 14, 9, 7, 5, 3, 1
};

string FatFilename::getFilename()
{
    string filename = string(data.rbegin(), data.rend());
    data = "";

    return filename;
}

void FatFilename::append(char *buffer)
{
    if (buffer[0]&0x40) {
        data = "";
    }

    int i;
    for (i=0; i<sizeof(longFilePos); i++) {
        unsigned char c = buffer[longFilePos[i]];
        if (c != 0 && c != 0xff) {
            data += c;
        }
    }
}
<commit_msg>Better handling<commit_after>#include "FatFilename.h"
#include "FatEntry.h"
#include <string>

using namespace std;

#define FAT_LONG_NAME_LAST      0x40

// Offset of letters position in a special "long file name" entry
static unsigned char longFilePos[] = {
    30, 28, 24, 22, 20, 18, 16, 14, 9, 7, 5, 3, 1
};

string FatFilename::getFilename()
{
    string filename = string(data.rbegin(), data.rend());
    data = "";

    return filename;
}

void FatFilename::append(char *buffer)
{
    if (buffer[FAT_ATTRIBUTES] != 0xf) {
        return;
    }

    if (buffer[0]&FAT_LONG_NAME_LAST) {
        data = "";
    }

    int i;
    for (i=0; i<sizeof(longFilePos); i++) {
        unsigned char c = buffer[longFilePos[i]];
        if (c != 0 && c != 0xff) {
            data += c;
        }
    }
}

{'fraction_non_alphanumeric': 0.15342465753424658, 'fraction_numerical': 0.03904109589041096, 'mean_word_length': 2.6343283582089554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2432390', 'n_tokens_mistral': 564, 'n_tokens_neox': 505, 'n_words': 144}