aboutsummaryrefslogtreecommitdiff
path: root/win32 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* stty: adjust console buffer when console size changessttyRon Yorston2016-08-031-0/+6
| | | | | | The console buffer width is made to match the console width; the buffer height must always be greater than or equal to the number of rows in the console.
* stty: changes required to build for WIN32Ron Yorston2016-08-024-4/+77
|
* win32: allow for vsnprintf returning -1Ron Yorston2016-07-081-1/+6
| | | | | | | vsnprintf can return -1. I've seen it do this when writing to a small buffer while vsnprintf(NULL, 0, ...) returns a valid length. I'd prefer not to rely on the latter working with arbitrary old Windows runtimes so just skip ANSI emulation if -1 is returned.
* win32: correct cast of argument to _open_osfhandleRon Yorston2016-05-252-6/+6
|
* win32: return an error when lseek is applied to a pipeRon Yorston2016-05-241-0/+14
| | | | | | | | | | | tail failed to process input from a pipe correctly: $ echo -n 54321 | tail -c 3 543 It was trying to use lseek as an optimisation but WIN32 lseek doesn't return an error whan applied to a pipe. Fix this by providing a wrapper for lseek.
* ash: fix use of pid/handle in waitpid_childRon Yorston2016-05-181-1/+13
| | | | | | | | | | Previously spawn was returning a process handle which was treated as a pid in certain circumstances. This resulted in the following failing: find . -type f | sed xargs -n 1 sed -n '1 p' It should output the first line of each file but stopped after the first.
* win32: adjustments to spawn functionsRon Yorston2016-05-181-10/+10
| | | | | | | | Make mingw_spawn_applet and mingw_spawn_1 static. The return value from spawnve is an exit code in synchronous mode and a process handle in asynchronous mode. Pass these upwards without interpretation.
* winansi: revert to previous console behaviour for vi/lessRon Yorston2016-04-261-0/+18
| | | | | | | | | | | | Recent changes to make the Windows console behave more like a *nix terminal didn't work too well for vi/less. On *nix the terminal buffer can't be scrolled while such screen-based applications are running. In the Windows console this remained possible and led to confusion. Add a new routine to allow vi/less to revert to their previous behaviour where the cursor is positioned at the top of the buffer and the entire buffer is cleared.
* lineedit: move console viewport to cursor on keypressRon Yorston2016-04-261-1/+1
| | | | | | When a normal *nix terminal has been scrolled back through its buffer, any keypress will return to the cursor position. Add code to lineedit.c to do the same for the Windows console.
* winansi: speed up clearing of screenRon Yorston2016-04-261-15/+10
| | | | | | | | | | | | | | | Various tasks on the shell command line (e.g. backspace, DEL, reverse search) were found to be slow when the console screen buffer was very large. This was because the entire buffer was being cleared in erase_till_end_of_screen(). Rewrite erase_till_end_of_screen() to only clear to the end of the visible screen and to be tidier. (Based on a suggestion by GitHub user avih.) Also, modify move_cursor to use coordinates relative to the current display (as ANSI escapes expect) rather than relative to the screen buffer.
* win32: fix quoting of arguments with trailing backslashesRon Yorston2016-03-161-15/+48
| | | | | | | | Correctly handle the case where an argument needs to be quoted and has a backslash as its last character. The issue was detected by the test "sed a cmd ended by double backslash" in the BusyBox test suite.
* Silence a couple of compiler warningsRon Yorston2016-03-062-2/+3
|
* mingw: silently ignore O_NONBLOCK on file openRon Yorston2016-02-221-2/+1
|
* win32: improve implementation of statfsRon Yorston2015-11-012-13/+12
| | | | The WIN32 calls should be passed the root directory of the filesystem.
* ln: enable in default configurationRon Yorston2015-10-191-0/+2
|
* win32: fix implementation of '%z' in strftimeRon Yorston2015-10-131-0/+27
| | | | | | | | Windows' strftime prints the name of the timezone rather than the timezone offset for '%z'. Add a hack to do it properly. Windows' strftime also uses its own version of the timezone name for '%Z'. A workaround for this is to set the TZ environment variable.
* win32: append '/' to bare drive name in opendirRon Yorston2015-09-301-0/+15
| | | | Make 'ls c:' and 'ls c:/*' do the right thing.
* win32: remove setitimer implementation and SIGALRM handlingRon Yorston2015-07-261-124/+0
| | | | | | | Commit 69f49ea imported a setitimer implementation from git. Since setitimer isn't used at all in BusyBox it can be removed. The same technique could be used to implement alarm but nothing in the WIN32 port uses that (yet).
* winansi: fixes to cursor positioning, screen clearingRon Yorston2015-07-171-4/+15
| | | | | | | | | | It seems that the cursor positioning escape sequence 'ESC[n;mH' allows n and m values of 0 or 1 to represent the leftmost/topmost position. Allow for this and also fix handling of missing values. When the screen is cleared using FillConsoleOutputCharacterA it's also necessary to make explicit calls to FillConsoleOutputAttribute to reset attributes.
* mingw: enable support for IPv6Ron Yorston2015-07-152-0/+256
| | | | Import inet_pton from gnulib and enable IPv6 support by default.
* win32: silence some compiler warningsRon Yorston2015-07-154-11/+14
|
* ipcalc: enable by default for WIN32Ron Yorston2015-07-131-0/+0
|
* Allow different ways to manipulate environment for XP vs 64-bitRon Yorston2015-07-031-0/+59
| | | | | | | | | | | Commit fa147bd 'Use putenv to implement unsetenv/clearenv' allowed BusyBox to run on ReactOS but broke it on Windows XP so it was reverted. It turns out that the same change is required on 64-bit Windows. Reinstate the 'safe' environment manipulation code but make it a configuration option. Add a config file for 64-bit Windows that does the right thing.
* mingw: fixes to implementation of waitpid(2)Ron Yorston2015-05-291-2/+2
| | | | | The third argument should be int. We only support positive pid values.
* mingw: fix conditions under which open(2) sets errno to EISDIRRon Yorston2015-05-291-1/+1
|
* mingw: buffer in do_stat_internal need not be staticRon Yorston2015-05-291-1/+1
|
* mingw: tidy up implementation of kill(2)Ron Yorston2015-05-292-10/+14
|
* mingw: add routine to pipe a file descriptor to/from a commandRon Yorston2015-05-271-18/+128
|
* mingw: define a macro for spawnRon Yorston2015-05-271-1/+1
|
* win32: fix waitpid implementationRon Yorston2015-05-271-2/+11
| | | | _cwait requires a process handle, not a pid.
* mingw: provide fake getgroups and getgrouplistRon Yorston2015-05-181-0/+22
| | | | | This makes it possible to enable the id and groups applets, though the results they return are worthless.
* mingw: implement getpwnam (but only for current user)Ron Yorston2015-05-181-0/+12
| | | | This allows the shell to expand ~user.
* mingw: import select from gnulibRon Yorston2015-04-222-0/+574
| | | | | | | | | | | | There are two changes from gnulib: Treat a broken pipe as readable. If nc doesn't try to read from the pipe it'll never find out it's broken. Only allow console key press events to indicate that stdin is readable. read_key leaves a key release event in the buffer at the end of a shell command. This caused nc to block, thinking that the console had input available.
* mingw: additional networking supportRon Yorston2015-04-221-0/+47
|
* mingw: remove unused code from read_keyRon Yorston2015-04-221-5/+0
|
* Allow globbing to be enabled with mingw64Ron Yorston2015-04-121-6/+15
| | | | | | | | | | mingw64 handles globbing differently from mingw32. Add code to allow globbing to be enabled. (By default mingw64 has globbing disabled, though the default can be changed when it's compiled.) Also change the configuration option from ENABLE_NOGLOB to ENABLE_GLOBBING, because double negatives make me think too much. The default is still for globbing to be disabled.
* mingw: changes to handling of directory permissionsRon Yorston2015-03-251-0/+21
| | | | | | | | | The read-only attribute on a directory in Microsoft Windows is quite different from write permission in POSIX. Modify rmdir(2) and chmod(2) to provide more POSIX-like behaviour: rmdir will remove a directory even if it's read-only chmod won't make a directory read-only
* test: fix access check bug; tweak fake file modeRon Yorston2015-03-241-0/+3
| | | | | | | | | | | Changing the fake uid from 0 to 1000 uncovered a problem with file access checks in test. Previously the tests were short-circuited because it thought we were root. With a non-root user the tests were performed, but the mode bits had been redefined for WIN32. Also adjust the fake file mode returned by stat so that the user and group modes are identical. Other users have the same modes as user but without write permission.
* Enable logname in mingw32 configurationRon Yorston2015-02-271-0/+17
|
* Make uid/gid handling more consistentRon Yorston2015-02-261-14/+51
| | | | | | | | Various fake POSIX routines returned different values for uid/gid: getuid/getgid used 1, stat used 0 and getpwuid used 1000. Standardise on 1000. Also, add fake getgrgid.
* Changes to allow building with MinGW-w64Ron Yorston2015-01-051-0/+5
|
* Revert "Use putenv to implement unsetenv/clearenv"Ron Yorston2014-12-181-46/+11
| | | | This reverts commit fa147bd7ecb086f4fb9a4afea16b946693a822ce.
* date: add support for %s formatRon Yorston2014-12-021-3/+15
|
* Move definition of bb_got_signal to mingw.cRon Yorston2014-11-291-0/+2
| | | | | On POSIX platforms bb_got_signal is defined in libbb/signals.c; for MinGW put the definition in win32/mingw.c. This is better than the
* Use putenv to implement unsetenv/clearenvRon Yorston2014-11-231-11/+46
| | | | | | | | | | noexec applets failed on ReactOS 0.3.17. This was because the environment was being manipulated directly using the environ pointer. Implementing unsetenv and clearenv using putenv fixes the problem. WIN32 putenv doesn't allow environment variables to have empty values. This was the case before and it's still the case after this change. Shell variables are fine.
* mingw.c: ignore EACCES from mkdir if directory existsRon Yorston2014-10-091-1/+14
| | | | | | | | | | | Microsoft Windows has a strange issue with access permissions such that mkdir will sometimes return EACESS for an existing directory. This is mentioned here: http://www.apijunkie.com/APIJunkie/blog/post/2009/12/22/_mkdir-C-runtime-library-function-might-return-unexpected-error-values.aspx This was causing mkdir -p to fail on a particular machine. Ignoring the EACCES error if the directory exists fixes the problem.
* mingw.c: add missing break in fcntl implementationRon Yorston2014-10-091-0/+1
| | | | | | This may address: https://github.com/rmyorston/busybox-w32/issues/25
* win32: attempt to get filesystem type for mntentRon Yorston2014-10-061-1/+8
|
* stat: give directories write and execute permissionsRon Yorston2014-08-161-1/+1
| | | | | | Microsoft Windows ignores the read-only attribute on directories and has no equivalent to the Unix execute permission on directories. Treat all directories as writable and searchable.
* Tidy up mingw_popenRon Yorston2014-05-151-59/+47
| | | | This also fixes piping output to a command in awk.