1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Add a simple FileSystemPath class that can canonicalize paths.

Also a simple StringBuilder to help him out.
This commit is contained in:
Andreas Kling 2018-10-28 08:54:20 +01:00
parent 43475f248b
commit 88ad59bfb1
6 changed files with 102 additions and 6 deletions

View file

@ -10,13 +10,26 @@
#include "Weakable.h"
#include "WeakPtr.h"
#include "CircularQueue.h"
#include "FileSystemPath.h"
static void testWeakPtr();
int main(int, char**)
int main(int c, char** v)
{
StringImpl::initializeGlobals();
{
const char* testpath = "/proc/../proc/1/../../proc/1/vm";
if (c == 2)
testpath = v[1];
FileSystemPath p(testpath);
if (p.string().isNull())
printf("canonicalized path is null\n");
else
printf("%s\n", p.string().characters());
return 0;
}
{
struct entry {
String s;