Commit Graph

7 Commits

Author SHA1 Message Date
Max Wipfli
fc6d051dfd AK+Everywhere: Add and use static APIs for LexicalPath
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.

To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
2021-06-30 11:13:54 +02:00
Sam Atkins
e79ef6461a cp: Copy sources into destination if it is already a directory
Previously, copying a file to a directory, like this:
```cp README.md Desktop```
correctly copied it to Desktop/README.md, but would fail if the
source was also a directory, for example:
```cp -R Documents Desktop```
Now, that correctly copies it to Desktop/Documents, as you would
expect. :^)
2021-06-21 16:50:29 +02:00
Linus Groh
f5c35fccca Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Mițca Dumitru
3f88fd81d1 cp: Use Core::File::copy_file_or_directory 2021-02-21 18:14:29 +01:00
Bui Quang Minh
ff67340d81 Userland: Support moving files between different mounted filesystems
In case we cannot use rename() because of cross-device error, copy file to the
destination then unlink the old source file.
2021-02-20 09:30:11 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00