mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
Utilities: Read positional arguments as Strings not char*s
This is a pretty trivial change so they're all batched together.
This commit is contained in:
parent
84b67754c0
commit
f0aba519c3
Notes:
sideshowbarker
2024-07-17 12:05:16 +09:00
Author: https://github.com/AtkinsSJ
Commit: f0aba519c3
Pull-request: https://github.com/SerenityOS/serenity/pull/13013
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/bgianfo
18 changed files with 46 additions and 52 deletions
|
@ -12,13 +12,11 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
|
||||
static bool file_exists(char const* path)
|
||||
static bool file_exists(String const& path)
|
||||
{
|
||||
struct stat st;
|
||||
int rc = stat(path, &st);
|
||||
int rc = stat(path.characters(), &st);
|
||||
if (rc < 0) {
|
||||
if (errno == ENOENT)
|
||||
return false;
|
||||
|
@ -34,7 +32,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio rpath cpath fattr"));
|
||||
|
||||
Vector<char const*> paths;
|
||||
Vector<String> paths;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.set_general_help("Create a file, or update its mtime (time of last modification).");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue