惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
I
InfoQ
H
Help Net Security
GbyAI
GbyAI
博客园 - 叶小钗
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
Y
Y Combinator Blog
L
LangChain Blog
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
博客园 - Franky
D
Docker
Jina AI
Jina AI
罗磊的独立博客

Martin Owens activity

Martin Owens deleted project branch average-color-divide at Inkscape / inkscape Fix divide-by-zero crash when using calligraphy tool (d34276f8) · Commits · Inkscape / inkscape · GitLab Fix divide-by-zero crash when using calligraphy tool (!7923) · Merge requests · Inkscape / inkscape · GitLab Add selection file to bypass Windows command length limits (correction) (865df7a5) · Commits · Inkscape / inkscape · GitLab Draft: Fix AppImage crashing during save on older distros (!7922) · Merge requests · Inkscape / inkscape · GitLab e71fa7f8e0858aab87b7fc0814a30a8c88da9b43 to fe225a6b9e1042c7221d95173be22a02b3725337 · Martin Owens / inkscape · GitLab 403 Forbidden on Inkscape web server (#693) · Issues · Inkscape / inkscape-web · GitLab 403 Forbidden on Inkscape web server (#13509) · Issues · Inkscape / Inbox · GitLab Add selection file to bypass Windows command length limits (correction) (!7917) · 合并请求 · Inkscape / inkscape · GitLab Non-vertical axonometric axis implementation (!7912) · Merge requests · Inkscape / inkscape · GitLab Update split mode on tab switch (!7915) · Merge requests · Inkscape / inkscape · GitLab inset/offset as app functions so they can be used from CLI (!7914) · Merge requests · Inkscape / inkscape · GitLab Performace regresion in last month (#5879) · Issues · Inkscape / inkscape · GitLab [Regression] Right-aligned text has a new gap in 1.4.4 (#6130) · Issues · Inkscape / inkscape · GitLab [Regression] Right-aligned text has a new gap in 1.4.4 (#13498) · Issues · Inkscape / Inbox · GitLab c503804e014994d611de1b225bee8158c06448a8 to a4588d8ead1e7049b90c5a126962746ed286ab17 · Inkscape / inkscape-web · GitLab Validate the extensions of signature file uploads (a4588d8e) · 提交 · Inkscape / inkscape-web · GitLab Allow color conversions using static arrays instead of just vectors (e71fa7f8) · 提交 · Martin Owens / inkscape · GitLab Speed up ungroup on thousands of items (!7908) · Merge requests · Inkscape / inkscape · GitLab Incorrect handling of FontMatrix and transformation matrices with internal PDF import (#4845) · Issues · Inkscape / inkscape · GitLab Handling edge case of negative fonts in PDF (59040229) · 提交 · Inkscape / inkscape · GitLab Handling edge case of negative fonts in PDF (!7911) · 合并请求 · Inkscape / inkscape · GitLab Allow color conversions using static arrays instead of just vectors (33e65d1b) · Commits · Martin Owens / inkscape · GitLab Allow color conversions using static arrays instead of just vectors (9be5f867) · Commits · Martin Owens / inkscape · GitLab a9672ea1dff483b5b3aa8c6b5d88cd223001bef5 to 512a5e57602ac52e1d35782a7dcebae04262b2b8 · Martin Owens / inkscape · GitLab Add selection file to bypass Windows command length limits (!7905) · 合并请求 · Inkscape / inkscape · GitLab Revert Pango label changes (1.4.x) (!7907) · 合并请求 · Inkscape / inkscape · GitLab Crash on selecting a `<text>` object without a `<tspan>` inside (#5462) · Issues · Inkscape / inkscape · GitLab Fix breakage with Ubuntu 26.04 CI (!7904) · 合并请求 · Inkscape / inkscape · GitLab c673fdd5148253276826d4eda3951daaefb82607 to 356b31383ba324396a225686613236484305533d · Martin Owens / inkscape · GitLab
Add selection file to bypass Windows command length limit...
Martin Owens · 2026-04-29 · via Martin Owens activity
+2 −0
原始行号 差异行号 差异行
@@ -299,6 +299,8 @@ if(WIN32)
    ${MINGW_LIB}/girepository-1.0/Gdk-4.0.typelib
    ${MINGW_LIB}/girepository-1.0/Gsk-4.0.typelib
    ${MINGW_LIB}/girepository-1.0/Graphene-1.0.typelib
    ${MINGW_LIB}/girepository-1.0/GioWin32-2.0.typelib
    ${MINGW_LIB}/girepository-1.0/GLibWin32-2.0.typelib
    DESTINATION lib/girepository-1.0)

  # Aspell dictionaries
原始行号 差异行号 差异行
Subproject commit 243b23b7986612459650ade44faf8f9333257b73
Subproject commit 2626d26ba46c28c96f4d483ce3b2e6681aab2ada
+48 −0
原始行号 差异行号 差异行
@@ -15,6 +15,8 @@

#include "script.h"

#include <algorithm>
#include <climits>
#include <memory>
#include <ranges>
#include <glib/gstdio.h>
@@ -64,6 +66,7 @@
#include <windows.h>
#define KILL_PROCESS(pid) TerminateProcess(pid, 0)
#else
#include <unistd.h>
#define KILL_PROCESS(pid) kill(pid, SIGTERM)
#endif

@@ -602,6 +605,29 @@ void Script::effect(Inkscape::Extension::Effect *mod, ExecutionEnv *executionEnv
    _change_extension(mod, executionEnv, document, params, mod->ignore_stderr);
}

/**
 * Conservative budget for the maximum command-line size
 * Used to decide when to spill arguments to a file (see _change_extension).
 */
static size_t get_cmdline_budget()
{
#ifdef _WIN32
    // Windows: Length limit is fixed at 32737
    // Leave 4096 of overhead for executable and files
    return 28701; // 32737-4096
#else
    // Unix: Length limit is from sysconf
    // Leave 32K of overhead for executable, files, and environment
    // Also guard against sysconf failure (-1)
    long const arg_max = sysconf(_SC_ARG_MAX);
    size_t usable = 0;
    if (arg_max > 32768) {
        usable = static_cast<size_t>(arg_max) - 32768;
    }
    return std::max(size_t{_POSIX_ARG_MAX}, usable);
#endif
}

/**
 * Internally, any modification of an existing document, used by effect and resize_page extensions.
 */
@@ -627,6 +653,28 @@ void Script::_change_extension(Inkscape::Extension::Extension *module, Execution
              Inkscape::Extension::FILE_SAVE_METHOD_TEMPORARY);
    prefs->setBool("/options/svgoutput/disable_optimizations", false);

    // Workaround for command-line length limits
    // With thousands of arguments the accumulated command line overflows
    // Spill into a temp file and replace with a single --arg-file=<path>.
    auto tempfile_sel = Inkscape::IO::TempFilename("ink_sel_XXXXXX.txt");
    size_t cmdline_size = 0;
    for (auto const &p : params) {
        cmdline_size += p.size() + 1;
    }
    if (cmdline_size > get_cmdline_budget()) {
        try {
            auto sel_channel = Glib::IOChannel::create_from_file(tempfile_sel.get_filename(), "w");
            sel_channel->set_encoding("UTF-8");
            for (auto const &p : params) {
                sel_channel->write(p + "\n");
            }
            sel_channel->close();
            params = {"--arg-file=" + tempfile_sel.get_filename()};
        } catch (Glib::Error const &e) {
            g_warning("Script::_change_extension(): failed to spill args: %s", e.what());
        }
    }

    file_listener fileout;
    int data_read = execute(command, params, tempfile_in.get_filename(), fileout, ignore_stderr, pipe_diffs);
    if (data_read == 0) {