1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 12:21:48 +02:00

Fix various typos in source code

This only touches code comments, class names, documentation,
enumeration names and tests.
This commit is contained in:
Sergei Zimmerman 2025-05-25 20:14:11 +00:00
parent 9e97ecabb6
commit 114de63d88
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
63 changed files with 104 additions and 104 deletions

View file

@ -144,7 +144,7 @@ Hash Hash::parseSRI(std::string_view original)
{
auto rest = original;
// Parse the has type before the separater, if there was one.
// Parse the has type before the separator, if there was one.
auto hashRaw = splitPrefixTo(rest, '-');
if (!hashRaw)
throw BadHash("hash '%s' is not SRI", original);

View file

@ -23,7 +23,7 @@ std::string hiliteMatches(
auto m = *it;
size_t start = m.position();
out.append(s.substr(last_end, m.position() - last_end));
// Merge continous matches
// Merge continuous matches
ssize_t end = start + m.length();
while (++it != matches.end() && (*it).position() <= end) {
auto n = *it;

View file

@ -252,7 +252,7 @@ protected:
std::list<ExpectedArg> processedArgs;
/**
* Process some positional arugments
* Process some positional arguments
*
* @param finish: We have parsed everything else, and these are the only
* arguments left. Used because we accumulate some "pending args" we might

View file

@ -16,7 +16,7 @@
/**
* Awful hacky generation of the comparison operators by doing a lexicographic
* comparison between the choosen fields.
* comparison between the chosen fields.
*
* ```
* GENERATE_CMP(ClassName, me->field1, me->field2, ...)

View file

@ -8,7 +8,7 @@ namespace nix {
MakeError(ExecutableLookupError, Error);
/**
* @todo rename, it is not just good for execuatable paths, but also
* @todo rename, it is not just good for executable paths, but also
* other lists of paths.
*/
struct ExecutablePath
@ -51,7 +51,7 @@ struct ExecutablePath
*
* @param exe This must just be a name, and not contain any `/` (or
* `\` on Windows). in case it does, per the spec no lookup should
* be perfomed, and the path (it is not just a file name) as is.
* be performed, and the path (it is not just a file name) as is.
* This is the caller's respsonsibility.
*
* This is a pure function, except for the default `isExecutable`

View file

@ -68,7 +68,7 @@ static inline int fromDescriptorReadOnly(Descriptor fd)
std::string readFile(Descriptor fd);
/**
* Wrappers arount read()/write() that read/write exactly the
* Wrappers around read()/write() that read/write exactly the
* requested number of bytes.
*/
void readFull(Descriptor fd, char * buf, size_t count);

View file

@ -11,7 +11,7 @@
namespace nix {
/**
* Unix-style path primives.
* Unix-style path primitives.
*
* Nix'result own "logical" paths are always Unix-style. So this is always
* used for that, and additionally used for native paths on Unix.
@ -51,7 +51,7 @@ struct UnixPathTrait
* often manipulating them converted to UTF-8 (*) using `char`.
*
* (Actually neither are guaranteed to be valid unicode; both are
* arbitrary non-0 8- or 16-bit bytes. But for charcters with specifical
* arbitrary non-0 8- or 16-bit bytes. But for characters with specifical
* meaning like '/', '\\', ':', etc., we refer to an encoding scheme,
* and also for sake of UIs that display paths a text.)
*/

View file

@ -36,7 +36,7 @@ enum struct HashFormat : int {
/// @brief Lowercase hexadecimal encoding. @see base16Chars
Base16,
/// @brief "<hash algo>:<Base 64 hash>", format of the SRI integrity attribute.
/// @see W3C recommendation [Subresource Intergrity](https://www.w3.org/TR/SRI/).
/// @see W3C recommendation [Subresource Integrity](https://www.w3.org/TR/SRI/).
SRI
};
@ -66,7 +66,7 @@ struct Hash
/**
* Parse a hash from a string representation like the above, except the
* type prefix is mandatory is there is no separate arguement.
* type prefix is mandatory is there is no separate argument.
*/
static Hash parseAnyPrefixed(std::string_view s);

View file

@ -8,7 +8,7 @@ namespace nix {
class PosIdx
{
friend struct LazyPosAcessors;
friend struct LazyPosAccessors;
friend class PosTable;
friend class std::hash<PosIdx>;

View file

@ -564,7 +564,7 @@ struct FramedSink : nix::BufferedSink
void writeUnbuffered(std::string_view data) override
{
/* Don't send more data if an error has occured. */
/* Don't send more data if an error has occurred. */
checkError();
to << data.size();

View file

@ -54,7 +54,7 @@ struct SourceAccessor : std::enable_shared_from_this<SourceAccessor>
*
* @note Unlike Unix, this method should *not* follow symlinks. Nix
* by default wants to manipulate symlinks explicitly, and not
* implictly follow them, as they are frequently untrusted user data
* implicitly follow them, as they are frequently untrusted user data
* and thus may point to arbitrary locations. Acting on the targets
* targets of symlinks should only occasionally be done, and only
* with care.

View file

@ -15,7 +15,7 @@ namespace nix {
namespace {
// This function is needed to handle non-blocking reads/writes. This is needed in the buildhook, because
// somehow the json logger file descriptor ends up beeing non-blocking and breaks remote-building.
// somehow the json logger file descriptor ends up being non-blocking and breaks remote-building.
// TODO: get rid of buildhook and remove this function again (https://github.com/NixOS/nix/issues/12688)
void pollFD(int fd, int events)
{

View file

@ -47,7 +47,7 @@ void writeFull(HANDLE handle, std::string_view s, bool allowInterrupts)
if (allowInterrupts) checkInterrupt();
DWORD res;
#if _WIN32_WINNT >= 0x0600
auto path = handleToPath(handle); // debug; do it before becuase handleToPath changes lasterror
auto path = handleToPath(handle); // debug; do it before because handleToPath changes lasterror
if (!WriteFile(handle, s.data(), s.size(), &res, NULL)) {
throw WinError("writing to file %1%:%2%", handle, path);
}