Commit graph

21478 commits

Author SHA1 Message Date
Jelle Raaijmakers e72e621d89 Ports/PHP: Enable OpenSSL extension 2021-06-05 13:02:13 +02:00
Jelle Raaijmakers fccba571a2 Ports/PHP: Disable PCRE JIT
The PCRE JIT creates memory that needs to be readable, writable and
executable at the same time. Serenity does not like this, so disable
it. This JIT is of limited use for the current applications of PHP
within Serenity anyway :-)
2021-06-05 13:02:13 +02:00
Jelle Raaijmakers 012a5b145b Ports/PHP: Enable Zlib extension 2021-06-05 13:02:13 +02:00
Jelle Raaijmakers 64e2e2cff3 Ports/PHP: Enable Phar extension 2021-06-05 13:02:13 +02:00
Daniel Bertalan 169e93f0a7 Kernel: Perform output processing on echo
Previously, we would echo characters back just as they were passed to
us, even in canonical mode. This caused newlines to not work correctly
in some programs.

Fixes #7802
2021-06-05 13:01:39 +02:00
Andreas Kling 42fcc2219d LibJS: Use PropertyName::as_string() in Object::get()
After we've already checked is_string(), we can use as_string() to
avoid a temporary String.
2021-06-05 13:00:34 +02:00
Andreas Kling 66f15c2e0c AK: Always inline FlyString::view() 2021-06-05 12:36:14 +02:00
Sahan Fernando d02e7b3811 LibWasm: Move Wasm::BytecodeInterpreter into its own header 2021-06-05 14:31:54 +04:30
Marcus Nilsson 94551149d1 TreeView: Don't try to move cursor with invalid index
When clicking on the TreeView in profiler without selecting a node and
then pressing up or pgup, cursor_index was in an invalid state. Instead
select the first node in the index.
2021-06-05 11:27:05 +02:00
Tim Schumacher f295ac3c0b rm: Allow empty paths if -f is specified
On most (if not all) systems rm ignores an empty paths array if -f or
--force is specified. This helps with scripts that may pass an empty
variable where the file paths are supposed to go.
2021-06-05 10:56:58 +02:00
Gunnar Beutner aec941b46c Ports: Add port for freeciv 2021-06-05 10:56:37 +02:00
Gunnar Beutner 4cd45f5875 LibC: Let setlocale() pretend that setting the locale succeeded
By returning nullptr we're telling the caller that setlocale() failed.
Some programs expect setlocale() to succeed so let's pretend that it
did.
2021-06-05 10:56:37 +02:00
Gunnar Beutner 431bed5158 Ports: Specify missing library when linking SDL2_ttf 2021-06-05 10:56:37 +02:00
Gunnar Beutner 7e1f413a89 Ports: Build shared library for freetype 2021-06-05 10:56:37 +02:00
yegor 6f0092edb8 Ports: fix gcc for mac users
BSD sed differs from GNU sed with the `-i` option.
This commit changes the sed line in package.sh to be
portable across macOS and Linux.
2021-06-05 10:56:04 +02:00
Max Wipfli 2164d8aae8 AK: Stop using U+0000 as end of file code point in URL parser
This changes URL parser to use the 0xFFFFFFFF constant instead of 0 to
indicate end of file. This fixes a bug where inputs containing null
bytes would terminate the parser early, because they were interpreted
as end of file.
2021-06-05 10:53:31 +02:00
Max Wipfli 97425c7dfb AK: Make debugging URLParser easier
This patch adds a state_name method to URLParser to convert a state to a
string. With this, the debugging statements now display the state names.

Furthermore, this fixes a bug where non-ASCII code points were
formatted as characters, which fails an assertion in the formatting
system.
2021-06-05 10:53:31 +02:00
Max Wipfli 99d5555134 AK: Do not trim away non-ASCII bytes when parsing URL
Because non-ASCII code points have negative byte values, trimming away
control characters requires checking for negative bytes values.

This also adds a test case with a URL containing non-ASCII code points.
2021-06-05 10:53:31 +02:00
Max Wipfli 44937e2dfc AK: Update URLParser.{cpp,h} to use east const 2021-06-05 10:53:31 +02:00
Idan Horowitz 0f8ed6183b LibJS: Add the Number.{MAX, MIN}_VALUE constants 2021-06-05 02:38:37 +01:00
Jelle Raaijmakers 3dab9d0b5c Kernel: Implement offset for lseek with SEEK_END 2021-06-04 23:49:48 +02:00
Timothy Flynn f73bb164ad LibCards: Draw card stack background when the entire stack is moving
The stack background should be painted when the entire stack is being
dragged, rather than just the top card.

Fixes #7786. Regressed in 2b762ef940.
2021-06-04 23:48:25 +02:00
Jelle Raaijmakers f6d372b2ab Kernel: Process::exec(): Check if path is a regular file
https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html

  [EACCES] The new process image file is not a regular file and the
           implementation does not support execution of files of its
           type.

Let's check whether the passed `path` is indeed a regular file.
2021-06-04 23:45:17 +02:00
Jelle Raaijmakers 9510425845 Shell: Add TMPDIR environment variable
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/
V1_chap08.html

  TMPDIR  This variable shall represent a pathname of a directory made
          available for programs that need a place to create temporary
          files.

Ports like PHP benefit from having this environment variable set, and
there exist a lot of scripts that assume the presence of such an
environment variable.
2021-06-04 23:44:59 +02:00
Gunnar Beutner a42383523a Kernel: Update the TX byte counter when sending network packets
This previously worked but was broken by b436dd1.
2021-06-05 00:36:55 +04:30
Max Wipfli ec2f0fc8eb LibCpp: Fix off-by-one error in SyntaxHighlighter
This changes the C++ SyntaxHighlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.

Contrary to other syntax highlighters, for this one the change has been
made to the SyntaxHighlighter rather than the Lexer. This is due to the
fact that the Parser also uses the same Lexer. I'm soure there is some
more elegant way to do this, but this patch at least unbreaks the C++
syntax highlighting.
2021-06-05 00:32:28 +04:30
Max Wipfli 617c54a00b LibCpp: Do not emit empty whitespace token after include statement
If an include statement didn't contain whitespace between the word
"include" and the '<' or '"', the lexer would previous emit an empty
whitespace token. This has been changed now.
2021-06-05 00:32:28 +04:30
Max Wipfli 2aa0cbaf22 LibCpp: Use CharacterTypes.h and constexpr functions in Lexer 2021-06-05 00:32:28 +04:30
Max Wipfli d57d7bea1c LibCpp: Use east const style in Lexer and SyntaxHighlighter 2021-06-05 00:32:28 +04:30
Max Wipfli 282a623853 LibWeb: Change a few source end positions in HTMLTokenizer
This patch aims to fix wrong highlighting for some cases in HTML's
syntax highlighter. The values were somewhat experimentally determined
are are subject to change. Regardless, it should be more correct with
this patch than without it. :^)
2021-06-05 00:32:28 +04:30
Max Wipfli 44c438d0ca LibWeb: Fix off-by-one error in SyntaxHighlighter
This changes the HTML SyntaxHighlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor. It also
avoids emitting tokens if they have a zero or negative length.

This fixes a bug where single-character tokens were not highlighted
properly.
2021-06-05 00:32:28 +04:30
Max Wipfli 932161e581 LibWeb: Be more forgiving when adding source positions in HTMLTokenizer
This patch changes HTMLTokenizer::nth_last_position to not fail if the
requested position is not available. Rather, it will just return (0-0).

While this is not the correct solution, it prevents the tokenizer from
crashing just because it cannot find a source position. This should only
affect SyntaxHighlighter.
2021-06-05 00:32:28 +04:30
Max Wipfli 93d830b5cc LibWeb: Add debugging statements in SyntaxHighlighter
This also changes SyntaxHighlighter.{h,cpp} to use east const style.
2021-06-05 00:32:28 +04:30
Max Wipfli 04897f6842 LibSQL: Fix off-by-one error in SyntaxHighlighter
This changes the SQL SyntaxHighlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.
2021-06-05 00:32:28 +04:30
Max Wipfli a9378ce5c2 LibSQL: Clean up SyntaxHighlighter code
This changes SyntaxHighlighter.{cpp,h} to use east const style. It also
removes two unused headers and simplifies a loop.
2021-06-05 00:32:28 +04:30
Max Wipfli 261f233060 Shell: Fix off-by-one error in SyntaxHighlighter
This changes the Shell syntax highlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.

This also adds some debug output to make debugging easier.
2021-06-05 00:32:28 +04:30
Max Wipfli cb5a50d3f7 LibGUI: Fix off-by-one error in Lexer tokens
This changes the INI and GML lexers to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.

The other user of GMLToken::m_end, GMLAutocompleteProvider, has been
modified to take into account that end position columns have been
incremented by one.
2021-06-05 00:32:28 +04:30
Max Wipfli e7b5dbe1ac LibGUI: Use CharacterTypes.h and constexpr functions in {INI,GML}Lexer 2021-06-05 00:32:28 +04:30
Max Wipfli e10278402f LibGUI: Use east const style in {INI,GML}Lexer.{cpp,h} 2021-06-05 00:32:28 +04:30
Max Wipfli 106ad6ba09 LibJS: Fix off-by-one error in SyntaxHighlighter
This changes the JS syntax highlighter to conform to the now-fixed
rendering of syntax highlighting spans in GUI::TextEditor.
2021-06-05 00:32:28 +04:30
Max Wipfli a819f98956 LibGUI: Fix off-by-one error in rendering of highlighted text
This fixes an off-by-one error in TextEditor's rendering of the syntax
highlighting as generated by Syntax::Highlighter and its subclasses.

Before, a single character span was e.g. (0-3) to (0-3), but this was
considered invalid by GUI::TextRange. Now, a single character span would
be e.g. (0-3) to (0-4).

This fix requires all Syntax::Highlighter subclasses to be adjusted, as
they all relied on the previous implementation. This will then also fix
a bug where single-character HTML tags wouldn't be highlighted.
2021-06-05 00:32:28 +04:30
Gunnar Beutner 8f81d9ad90 AK: Verify that functions aren't modified while they're being invoked
A Function object should not be set to a different functor while the
original functor is currently executing.
2021-06-04 19:32:25 +02:00
Gunnar Beutner 44418cb351 AK: Allow deferring clear() for the Function class
Ideally a Function should not be clear()ed while it's running.
Unfortunately a number of callers do just that and identifying all of
them would require inspecting all call sites for operator() and clear().

Instead this adds support for deferring clear() until after the
function has finished executing.
2021-06-04 19:32:25 +02:00
Gunnar Beutner fab9b2f068 Hearts: Don't destroy the animation handler while running it 2021-06-04 19:32:25 +02:00
Itamar fdaec58f59 HackStudio: Add comment about lexicographical insertion to ClassView 2021-06-04 19:29:22 +02:00
Itamar c1b2003687 HackStudio: Use Node's name when inserting to the ClassView tree
Previously, when traversing the ClassView tree to find the parent of a
new node, we used the name of the node's declaration to find the path
to the parent in the tree.

However, some nodes in the tree do not have a matching declaration,
which caused a VERIFY failure.

To fix this, we now use the node's name when walking the tree.
We can do this because the node's name should be identical to the name
of its declaration.

Closes #7702.
2021-06-04 19:29:22 +02:00
Timothy Flynn 2b762ef940 Solitaire+LibCards: Draw card stacks with rounded corners
Now that the cards have rounded corners, draw the stack box behind the
cards with rounded corners as well. This way, the corner of the stack
box doesn't peek out from behind the cards.

The caveat here is that the "play" card stack now needs to hold a
reference to the "waste" stack beneath it so it knows when not to draw
its background on top of the waste stack. To faciliate that, the array
of card stacks is now a NonnullRefPtrVector so the play stack can store
a smart pointer to the waste stack (instead of a raw pointer or
reference).
2021-06-04 19:11:45 +02:00
Timothy Flynn 4903186cc5 LibGfx: Add helper for painting a rounded rect with equal corner radii 2021-06-04 19:11:45 +02:00
Maciej Zygmanowski bee1e06055 hostname: Handle 'sethostname' errors 2021-06-04 19:11:27 +02:00
Gunnar Beutner d840608a51 Taskbar: Make sure LibGUI/Desktop.h is usable in ports
Now that Desktop.h includes Services/Taskbar/TaskbarWindow.h we have
to install Taskbar's header files so that Desktop.h can be used in
ports or when building software in-target.
2021-06-04 19:11:13 +02:00