1
0
Fork 0

Improve compliance when printing drive labels

This commit is contained in:
krcroft 2020-01-19 21:53:42 -08:00 committed by Patryk Obara
parent 508d338c27
commit c7484ceaaa
5 changed files with 31 additions and 8 deletions

View file

@ -21,6 +21,7 @@
#include <assert.h>
#include <cctype>
#include <ctype.h>
#include <functional>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@ -51,6 +52,15 @@ void trim(std::string &str) {
if (loc != std::string::npos) str.erase(loc+1);
}
void strip_punctuation(std::string &str) {
str.erase(
std::remove_if(
str.begin(),
str.end(),
[](unsigned char c){ return std::ispunct(c); }),
str.end());
}
/*
Ripped some source from freedos for this one.