mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 19:28:29 +00:00
Fix basename() and dirname()
This commit is contained in:
parent
9b11206ae3
commit
04d39d47f1
41 changed files with 489 additions and 207 deletions
|
@ -960,7 +960,7 @@ int main(int argc, char *argv[]) {
|
|||
fin = fdopen(pipefds[0], "r");
|
||||
t = NewTrace();
|
||||
for (ev = 0, lineno = 1; !interrupted && (line = xgetline(fin)); ++lineno) {
|
||||
chomp(line);
|
||||
_chomp(line);
|
||||
Parse(t, line, lineno);
|
||||
free(line);
|
||||
for (; ev < t->events.n && !t->events.p[ev].is_interrupted; ++ev) {
|
||||
|
|
|
@ -152,7 +152,7 @@ int main(int argc, char *argv[]) {
|
|||
int y, x;
|
||||
ShowCrashReports();
|
||||
f = stdin;
|
||||
while ((s = chomp(xgetline(f)))) {
|
||||
while ((s = _chomp(xgetline(f)))) {
|
||||
n = strwidth(s, 0);
|
||||
xn = MAX(xn, n);
|
||||
T = xrealloc(T, ++yn * sizeof(*T));
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
(let ((stab (copy-syntax-table)))
|
||||
(with-syntax-table stab
|
||||
(modify-syntax-entry ?+ " ")
|
||||
(modify-syntax-entry ?* " ")
|
||||
(let ((thing (thing-at-point 'symbol no-properties)))
|
||||
(when thing
|
||||
(intern thing))))))
|
||||
|
@ -146,6 +147,7 @@
|
|||
;; M-3 C-c C-c Compile w/ MODE=rel
|
||||
;; M-4 C-c C-c Compile w/ MODE=dbg
|
||||
;; M-5 C-c C-c Compile w/ MODE=""
|
||||
;; M-7 C-c C-c Compile w/ MODE=tinylinux
|
||||
;; M-8 C-c C-c Compile w/ llvm
|
||||
;; M-9 C-c C-c Compile w/ chibicc
|
||||
|
||||
|
@ -162,6 +164,7 @@
|
|||
((eq arg 3) "rel")
|
||||
((eq arg 4) "dbg")
|
||||
((eq arg 5) "")
|
||||
((eq arg 7) "tinylinux")
|
||||
((eq arg 8) "llvm")
|
||||
(default default)
|
||||
((cosmo-intest) "dbg")
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
|
|||
ShowCrashReports();
|
||||
f = fopen("/tmp/syms.txt", "r");
|
||||
memset(tabs, '\t', 64);
|
||||
while ((sym = chomp(xgetline(f)))) {
|
||||
while ((sym = _chomp(xgetline(f)))) {
|
||||
if (strlen(sym)) {
|
||||
printf("imp\t");
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
} else {
|
||||
while ((getline(&line_, &linecap_, stdin)) != -1) {
|
||||
processarg(chomp(line_));
|
||||
processarg(_chomp(line_));
|
||||
}
|
||||
free_s(&line_);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ void processfile(void) {
|
|||
int col, s;
|
||||
size_t off, len;
|
||||
while ((getline(&line_, &linecap_, fi_)) != -1) {
|
||||
chomp(line_);
|
||||
_chomp(line_);
|
||||
len = strlen(line_);
|
||||
s = concat(&pool_, line_, len + 1);
|
||||
if (len < USHRT_MAX) {
|
||||
|
|
|
@ -148,7 +148,7 @@ void ProcessFile(void) {
|
|||
fg1 = -1u;
|
||||
glyph1 = -1u;
|
||||
while ((getline(&line_, &linecap_, in_)) != -1) {
|
||||
p = chomp(line_);
|
||||
p = _chomp(line_);
|
||||
sscanf(p, "%x, %u,%u,%u", &color, &bg, &fg, &glyph);
|
||||
if (color != color1) {
|
||||
if (color1 != -1u) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue