mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 01:40:28 +00:00
move back to proc, __static_yoink in paginate.c does not work
This commit is contained in:
parent
2dfb72d278
commit
38d0728107
1 changed files with 7 additions and 2 deletions
|
@ -19,7 +19,9 @@
|
||||||
#include "libc/calls/calls.h"
|
#include "libc/calls/calls.h"
|
||||||
#include "libc/calls/syscall_support-nt.internal.h"
|
#include "libc/calls/syscall_support-nt.internal.h"
|
||||||
#include "libc/dce.h"
|
#include "libc/dce.h"
|
||||||
|
#include "libc/intrin/kprintf.h"
|
||||||
#include "libc/intrin/safemacros.internal.h"
|
#include "libc/intrin/safemacros.internal.h"
|
||||||
|
#include "libc/intrin/weaken.h"
|
||||||
#include "libc/limits.h"
|
#include "libc/limits.h"
|
||||||
#include "libc/mem/gc.h"
|
#include "libc/mem/gc.h"
|
||||||
#include "libc/runtime/runtime.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
@ -28,6 +30,8 @@
|
||||||
#include "libc/temp.h"
|
#include "libc/temp.h"
|
||||||
#include "libc/x/x.h"
|
#include "libc/x/x.h"
|
||||||
|
|
||||||
|
__static_yoink("__utf16to8");
|
||||||
|
|
||||||
static char *get_pagerpath(char *pathbuf, size_t pathbufsz) {
|
static char *get_pagerpath(char *pathbuf, size_t pathbufsz) {
|
||||||
char *pagerpath;
|
char *pagerpath;
|
||||||
if (strcmp(nulltoempty(getenv("TERM")), "dumb") && isatty(0) && isatty(1) &&
|
if (strcmp(nulltoempty(getenv("TERM")), "dumb") && isatty(0) && isatty(1) &&
|
||||||
|
@ -43,9 +47,10 @@ static char *get_pagerpath(char *pathbuf, size_t pathbufsz) {
|
||||||
static bool run_pager(char *args[hasatleast 3]) {
|
static bool run_pager(char *args[hasatleast 3]) {
|
||||||
char16_t widepath[PATH_MAX];
|
char16_t widepath[PATH_MAX];
|
||||||
int n, pid;
|
int n, pid;
|
||||||
|
kprintf("utf16to8 %p\n", _weaken(__utf16to8));
|
||||||
if (IsWindows() && !strcasecmp(args[0], "/C/Windows/System32/more.com") &&
|
if (IsWindows() && !strcasecmp(args[0], "/C/Windows/System32/more.com") &&
|
||||||
(((n = __mkntpath(args[1], widepath)) == -1) ||
|
(!_weaken(__utf16to8) || ((n = __mkntpath(args[1], widepath)) == -1) ||
|
||||||
!(args[1] = gc(utf16to8(widepath, n, 0))))) {
|
!(args[1] = gc(_weaken(__utf16to8)(widepath, n, 0))))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((pid = fork()) != -1) {
|
if ((pid = fork()) != -1) {
|
Loading…
Add table
Add a link
Reference in a new issue