Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addbib: correctly re-open database #734

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Sep 9, 2024

  • I discovered the cause of the close() error I was seeing when editing a database entry with vi, then hitting y to continue
  • When continuing a new entry is expected to be appended to the database
  • The file was closed and re-opened between executing vi; however, due to the "my" declaration in the open() call an alias of the global filehandle $DATABASE was made
  • Make sure there is only one $DATABASE variable; now I can correctly append new entries after editing an entry with vi
%perl addbib 123c
Instructions? (n) n
Author name: 123
Title: 123
Journal: 123
Volume: 123
Pages: 123
Publisher: 123
City: 123
Date: 123
Other: 123
Keywords: 123
Abstract: 123
Continue? (y) vi
Continue? (y) y
Author name: this 
Title: 234
Journal: 234
Volume: 234
Pages: 234
Publisher: 234
City: 234
Date: 234
Other: 234
Keywords: 234
Abstract: 23444
Continue? (y) n
%cat 123c # empty line1 had been deleted from 1st database entry with vi
%A	123
%T	123
%J	123
%V	123
%P	123
%I	123
%C	123
%D	123
%O	123
%K	123
%X	123

%A	this
%T	234
%J	234
%V	234
%P	234
%I	234
%C	234
%D	234
%O	234
%K	234
%X	23444

* I discovered the cause of the close() error I was seeing when editing a database entry with vi, then hitting y to continue
* When continuing a new entry is expected to be appended to the database
* The file was closed and re-opened between executing vi; however, due to the "my" declaration in the open() call an alias of the global filehandle $DATABASE was made
* Make sure there is only one $DATABASE variable; now I can correctly append new entries after editing an entry with vi
@github-actions github-actions bot added the Type: enhancement improve a feature that already exists label Sep 9, 2024
@github-actions github-actions bot added Priority: low get to this whenever Program: addbib The addbib program labels Sep 9, 2024
@coveralls
Copy link

coveralls commented Sep 9, 2024

Pull Request Test Coverage Report for Build 10765406861

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 73.069%

Totals Coverage Status
Change from base Build 10765147047: -0.7%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

@briandfoy briandfoy self-assigned this Sep 9, 2024
@briandfoy
Copy link
Owner

changes: fix database re-opening that was masking a lexical variable

@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Sep 9, 2024
@briandfoy briandfoy added Type: bug an existing feature does not work and removed Type: enhancement improve a feature that already exists labels Sep 9, 2024
@briandfoy briandfoy merged commit 66c1cae into briandfoy:master Sep 9, 2024
22 of 23 checks passed
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: addbib The addbib program Status: released there is a new release with this fix Type: bug an existing feature does not work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants