diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-12-11 15:31:04 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-12-11 15:31:04 -0800 |
commit | d5c86dfd8706e6b3ceee7843464797e6fcad4259 (patch) | |
tree | 34f07b48140270e32e0a3eefe136ece090db2170 /html/088file.mu.html | |
parent | e7f65b0a4b0af23f5107fb44b8dc39514411589d (diff) | |
download | mu-d5c86dfd8706e6b3ceee7843464797e6fcad4259.tar.gz |
3704
Bugfix: writing to a new file in a non-empty fake file system. The one time I try to get a little clever, it bites me in the ass. That'll teach me..
Diffstat (limited to 'html/088file.mu.html')
-rw-r--r-- | html/088file.mu.html | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/html/088file.mu.html b/html/088file.mu.html index 8f044eaa..49801745 100644 --- a/html/088file.mu.html +++ b/html/088file.mu.html @@ -170,10 +170,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color tmp:resource <span class="Special"><-</span> index *data, i curr-filename <span class="Special"><-</span> get tmp, <span class="Constant">name:offset</span> found?:bool <span class="Special"><-</span> equal filename, curr-filename - <span class="muControl">loop-unless</span> found? - put-index *data, i, new-resource - reset lock - <span class="muControl">return</span> + <span class="Delimiter">{</span> + <span class="muControl">break-unless</span> found? + put-index *data, i, new-resource + <span class="muControl">jump</span> <span class="Constant">+unlock-and-exit</span> + <span class="Delimiter">}</span> + i <span class="Special"><-</span> add i,<span class="Constant"> 1</span> + <span class="muControl">loop</span> <span class="Delimiter">}</span> <span class="Comment"># if file didn't already exist, make room for it</span> new-len:num <span class="Special"><-</span> add len,<span class="Constant"> 1</span> @@ -189,6 +192,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">}</span> <span class="Comment"># write new file</span> put-index *new-data, len, new-resource +<span class="Constant"> +unlock-and-exit</span> reset lock ] </pre> |