Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Shell's .read pipe now works for Windows too. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
929bcc4098549692c573779d65c4c280 |
User & Date: | larrybr 2021-09-17 21:12:47.392 |
Context
2021-09-18
| ||
16:15 | Further tests for legacy rtree geom callbacks. (check-in: 99d6bb22e8 user: dan tags: trunk) | |
2021-09-17
| ||
21:12 | Shell's .read pipe now works for Windows too. (check-in: 929bcc4098 user: larrybr tags: trunk) | |
20:43 | Add tests for legacy geometry callbacks to rtreedoc2.test. (check-in: 6ad00e52ed user: dan tags: trunk) | |
Changes
Changes to src/shell.c.in.
︙ | ︙ | |||
631 632 633 634 635 636 637 | while( *z ){ if( (0xc0&*(z++))!=0x80 ) n++; } return n; } /* | | | > | < > > > > > > > > > > > > > > > > > < | 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | while( *z ){ if( (0xc0&*(z++))!=0x80 ) n++; } return n; } /* ** Return open FILE * if zFile exists, can be opened for read ** and is an ordinary file or a character stream source. ** Otherwise return 0. */ static FILE * openChrSource(const char *zFile){ #ifdef _WIN32 struct _stat x = {0}; # define STAT_CHR_SRC(mode) ((mode & (_S_IFCHR|_S_IFIFO|_S_IFREG))!=0) /* On Windows, open first, then check the stream nature. This order ** is necessary because _stat() and sibs, when checking a named pipe, ** effectively break the pipe as its supplier sees it. */ FILE *rv = fopen(zFile, "rb"); if( rv==0 ) return 0; if( _fstat(_fileno(rv), &x) != 0 || !STAT_CHR_SRC(x.st_mode)){ fclose(rv); rv = 0; } return rv; #else struct stat x = {0}; int rc = stat(zFile, &x); # define STAT_CHR_SRC(mode) (S_ISREG(mode)||S_ISFIFO(mode)||S_ISCHR(mode)) if( rc!=0 ) return 0; if( STAT_CHR_SRC(x.st_mode) ){ return fopen(zFile, "rb"); }else{ return 0; } #endif #undef STAT_CHR_SRC } /* ** This routine reads a line of text from FILE in, stores ** the text in memory obtained from malloc() and returns a pointer ** to the text. NULL is returned at end of file, or if malloc() |
︙ | ︙ | |||
9238 9239 9240 9241 9242 9243 9244 | utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ rc = process_input(p); pclose(p->in); } #endif | | | 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 | utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ rc = process_input(p); pclose(p->in); } #endif }else if( (p->in = openChrSource(azArg[1]))==0 ){ utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ rc = process_input(p); fclose(p->in); } p->in = inSaved; |
︙ | ︙ |