gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7c9bbd)
raw | patch | inline | side by side (parent: a7c9bbd)
author | Doni Pracner <quinnuendo@gmail.com> | |
Fri, 25 May 2018 21:16:10 +0000 (23:16 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Fri, 25 May 2018 21:16:10 +0000 (23:16 +0200) |
kodovi/stek-i-red-opsluzivanja/StekIFajlovi.java | patch | blob | history |
diff --git a/kodovi/stek-i-red-opsluzivanja/StekIFajlovi.java b/kodovi/stek-i-red-opsluzivanja/StekIFajlovi.java
index 5685b7af1dfad450e022a03b58b1523eaa8f13e8..9f12b740014d7c7a5c0b890bc5173c95be638a3e 100644 (file)
public static Stek<Integer> ucitajStek(String imef) {
Stek<Integer> rez = new Stek<Integer>();
- while (!Svetovid.in(imef).isEmpty()) {
+ if (Svetovid.testIn(imef)) {
+ while (!Svetovid.in(imef).isEmpty() && !rez.jePun()) {
int broj = Svetovid.in(imef).readInt();
rez.stavi(broj);
+ }
+ Svetovid.in(imef).close();
}
- Svetovid.in(imef).close();
-
return rez;
}