auto-uref.scm fails if default uref is "?"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gEDA |
Fix Released
|
Medium
|
Unassigned |
Bug Description
auto-uref.scm fails if the default uref of the symbol is "?".
To reproduce:
1) activate auto-uref with the following lines in gnetlistrc:
(load-from-path "auto-uref.scm")
(add-hook! add-component-hook auto-uref)
2) put a symbol with refdes=? to some place where gschem finds it. E.g. the symbol attached to this report.
3) open gschem
4) add the symbol to the canvas
The auto-uref script when as the symbol is pasted to the schematic. The failure pulls down gschem, too. The application dies with this backtrace on the stdout:
/------
Backtrace:
In unknown file:
?: 0* [auto-uref (# # # # ...)]
?: {1}* (letrec (# # # # ...) (let* # #))
In /usr/local/
90: 2 (let* ((refdeses #) (refdes #) (prefix #)) (if prefix (let* # #)))
94: 3* (if refdes (get-prefix (cdr (get-attribute-
95: 4 [get-prefix "?"]
...
47: 5 (if (= 0 (match:end prefix)) #f (match:substring prefix))
47: 6* [= 0 ...
47: 7* [match:end #f]
In /usr/share/
125: 8 (let* ((matchnum (if # # {1})) (end (cdr #))) (if (= end -1) #f end))
128: 9* [cdr ...
128: 10* [vector-ref #f {1}]
/usr/share/
/usr/share/
\------
BTW, my use case for "refdes=?" is indeed sub sheet symbols. If the urefs of a heirarchy are mangled, I'd still like to keep them as short as possible -- A single character. If I need mor than one sub sheet per sheet, the character has to be unique. In addition, they should not interfere with the usual letters for components. Pure digits fit this agenda.
---<)kaimartin(>---
Changed in geda: | |
status: | Fix Committed → Fix Released |
The bug is legitimate one, as the code will fail whenever value of the refdes attribute does not start with a letter.
I'm not 100% sure if lifting the restriction for the refdes to start with a letter will not break something else, but we can test such change.